From nobody Thu Jul 30 02:48:04 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h9YXj6xBHz6mPnd for ; Thu, 30 Jul 2026 02:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h9YXj1hvpz3FWn for ; Thu, 30 Jul 2026 02:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785379685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CHKyqzMi6vxlDGXrIJJKmbINjGx5h9TMgBfV5Pdn9CE=; b=eu1DTRcwRCKHD1dkInQHEzbyJCNJtK0MpNWNeDM3WkHrNyaAHFOOzz39Zi65b4lhsL934x 8AA/WWIxadtFl/fT0WRmyquVgJ/2VEVZVLokh5zSuWxM3R2N87m1VWJEopOYWWMdk59cHP LPFGyRH1lWKd2VDU4HCps+3zLT3zi1YhtwU+z8Ojz1nzQoKHeF6JBNfFk/Mb/nj0ziPChN kcJAdMoiYTfYNK2sNq1UraE81+acc7Ty/FSaVlXNsPZChgE01kG0ziciYC0mfaFCTJ+txW XMaZsrZIK30H394cFNt0thxNRoV/A5M6lnLkRK4cVdtHPDWdfzAVbm+dAxG36g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785379685; a=rsa-sha256; cv=none; b=aO1JYZh/N6l1uyBbYzFK65u0ms6wQzZ4Dk/+OrUKOpeJR69o3KZvmBy/J5kmCJSbQ8rpr6 CCZeVXhvZvlZnN79bRB2/fSzsbxzMDnh+bNl45bKNGRblgNB8yfHx5mN7nrTvJC8pKxWNx HLlrpdwJCxxTYHWI4cMbKguL7bg928KHNTCPqjFdqDvO7cVZIxuBC7Vy4wdQfRcOVwedjD 9EJ++Vj6ylj/Ty5a3gJ3jftKfpjZ4l7l4Lwx7cXzgyLbDgdBRNhS2oSjTLtV/5zdqlxtjQ J64a9YMkAu/Zo+L3ym5Oztt0OPo01jr7mjzpzNgqeKHG/R7W1Rmp/XNj99okjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785379685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CHKyqzMi6vxlDGXrIJJKmbINjGx5h9TMgBfV5Pdn9CE=; b=RU0i9iiSV7p1sJIQXN9VtkAcKcM2A8eqAsXPY8t/9GCVjfcICRJf2QKgXX6OTJfGirdX+I /XVH4w/4MFyZUXa+Qq6yeNxw6AJa8MbJ2qecQ0iJEI20tPKw5U+mbNGS7oXyiyh/0pKyCx k9wCYw9U8C/dWlQEGeXIAe4lwWvmRynLmXmYaV0k4OSa/tub/KmCdQmhK8f5gnFEKUr+C5 moeweVeIn1+ItX9LfCmtV9PymiBK1xtq7ofiPpcKsIC7kwkasgJqNLpKx2zgBfsPcorBAG 5kXoONWVsLQwos7kRn2ajfvUkTyhyucvHD5y9awbPyE4pnULjR+kXz5BTyFo0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h9YXh6Y14ztjc for ; Thu, 30 Jul 2026 02:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1cdb3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 30 Jul 2026 02:48:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: bcb62ec0e3d5 - main - igb: Guard register dump during queue setup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bcb62ec0e3d592892f0f304269ed2722d1bae75a Auto-Submitted: auto-generated Date: Thu, 30 Jul 2026 02:48:04 +0000 Message-Id: <6a6abb64.1cdb3.7ee494c8@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=bcb62ec0e3d592892f0f304269ed2722d1bae75a commit bcb62ec0e3d592892f0f304269ed2722d1bae75a Author: Kevin Bowling AuthorDate: 2026-07-30 02:26:48 +0000 Commit: Kevin Bowling CommitDate: 2026-07-30 02:47:33 +0000 igb: Guard register dump during queue setup The register-dump sysctl is installed before iflib allocates the queue arrays and remains visible while they are freed. Return ENXIO outside the queue lifetime instead of dereferencing a NULL or stale array. Sponsored by: BBOX.io --- sys/dev/e1000/if_em.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index eaaa7c5fd2f0..42e7113bff48 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -845,6 +845,13 @@ static int em_get_regs(SYSCTL_HANDLER_ARGS) int rc; uint32_t rxqid, txqid; + /* + * This sysctl is registered before iflib allocates the queue arrays, + * and remains registered while iflib tears them down. + */ + if (sc->rx_queues == NULL || sc->tx_queues == NULL) + return (ENXIO); + regs_buff = malloc(sizeof(u32) * IGB_REGS_LEN, M_DEVBUF, M_WAITOK); memset(regs_buff, 0, IGB_REGS_LEN * sizeof(u32)); rxqid = sc->rx_queues[0].rxr.me;