From nobody Tue Sep 01 09:20:55 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 4hZ0hl6PVGz6qWb1 for ; Tue, 01 Sep 2026 09:20:55 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hZ0hl4zpKz3H2t for ; Tue, 01 Sep 2026 09:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788254455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R04ynkBS8jdKvG/dRSKoan9u50iYcBkEzIMJ6cw1CV8=; b=e89Psw9yentUybXIp+ioTg7AmU7Q5ZUZovUOqw67JnjR+yEztqcth28HLmQqdpDsSyUnDW fOTb7gVCCKqjd8GU/xFijyqGFu6yK2EuNKyGslx415TSyIxJHRLG9VIbr2W3/oyKE/r0Dj Cc7viyp8o8/pP9N0ZSo1lpoocYUC4NitHA7t3PnNCLdcyJU2GQ6ez9FiZPumDUgZFLY7W9 KTzl+LHZOtMjBdEH+egoulweVuArlI99n20aVv9HoLsbkM9DLjl1sa2v5srnXIARv7H7c/ gPeG0iJe38kROJrfGMHYANurYV3ON/bA7OcGZe2wMI0oyXgux7PaKZDIcomvcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788254455; a=rsa-sha256; cv=none; b=dkSEidk9g/v4hHjDkHbFyT0Xy3/DfVXcKdGjDJm5Fsc5WDR1N9wZgrZIUH7HFk5mOBIrFF 84e9ITQOutLS3pjXDmdCKsZG2nuwEd4nb0n1TcXZjkOmCmal9tSxomF+h0Ey7SMC3Nuh7C Z02Q+3/gEUh6y3d+QAAia/eOLNiZMniXKLXr2LMY3960dRHJLMriXMFel/4xuMh8kARUaz sJlyRlBDg2YRXOf8haePJhsbSprXR+R6ilYYheg54sYHq+lN0a84C0cPrDr8U1/5lv6cDK H0x/TDQR6o3qpP+GqNGdpgv7t04gNZcRd8Ccyg0iyCwI+QuEJSoMpllsczM+Eg== 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=1788254455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R04ynkBS8jdKvG/dRSKoan9u50iYcBkEzIMJ6cw1CV8=; b=XQmwUfypxavWgB3G89SJvSUNgqtv/gWzMIuMe5WBYBfxh60DyvBwpxncB3oFjhOw4qykW0 fHkyayD9GAMSTuw/Xbk8SJp75evGxNN2nMAOsL3+rjKUhaWAX9FZPIFrwX5ELLV4yyL3Xl ZoDc6LQdk76gik66EYKjL+G0lrSwl6H5NU15hTAsboxgE3CpczFSXPJrNkaOTexxpQYIl9 n/2TcRBcpN44Iysvzuf06svwqc3Ob2lbIggE4QYQpgnpiOygwcLJkSB/0X80ZdfRpVi/zz FBAglNBq2XmSuuOlnNlNjJQTIwgqK26iggd10NRVvG/A57agvtGCqGhyc4ZF5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hZ0hl2BP0zsSX for ; Tue, 01 Sep 2026 09:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 256ac by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 01 Sep 2026 09:20:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Sobczyk, Pawel From: Krzysztof Galazka Subject: git: e0954f796757 - stable/14 - ix(4): Sanitize negative error codes 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: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e0954f7967576149677a4585c28bd033815f41cf Auto-Submitted: auto-generated Date: Tue, 01 Sep 2026 09:20:55 +0000 Message-Id: <6a9698f7.256ac.65223cc6@gitrepo.freebsd.org> The branch stable/14 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=e0954f7967576149677a4585c28bd033815f41cf commit e0954f7967576149677a4585c28bd033815f41cf Author: Sobczyk, Pawel AuthorDate: 2026-08-18 08:10:54 +0000 Commit: Krzysztof Galazka CommitDate: 2026-09-01 09:20:25 +0000 ix(4): Sanitize negative error codes Due to development history FreeBSD driver error codes are reported the same way as in Linux (as negatives) which is inconsistent with FreeBSD standard. It may cause unexpected behavior when driver errors are interpreted by a kernel as syscall handler return values. This patch converts error codes from negative to positive values for NVM access functions. Signed-off-by: Pawel Sobczyk Reviewed by: kbowling, erj, milosz.linkiewicz_intel.com Tested by: Mateusz Moga Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D57642 (cherry picked from commit 33e2eac3e3e738daa95a06f42d6c661b87ad9aac) --- sys/dev/ixgbe/if_ix.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index f08405059677..abe226a5e11a 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1592,8 +1592,9 @@ ixgbe_nvm_access_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd) size_t ifd_len = ifd->ifd_len; size_t malloc_len; device_t dev = sc->dev; + s32 status; u8 *nvm_buffer; - s32 error = 0; + int error = 0; /* * ifioctl forwards SIOCxDRVSPEC to iflib without conducting @@ -1642,10 +1643,10 @@ ixgbe_nvm_access_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd) (nvm_buffer + sizeof(struct ixgbe_nvm_access_cmd)); /* Handle the NVM access request */ - error = ixgbe_handle_nvm_access(hw, cmd, data); - if (error) { + status = ixgbe_handle_nvm_access(hw, cmd, data); + if (status) { device_printf(dev, "%s: NVM access request failed, error %d\n", - __func__, error); + __func__, status); } /* Copy the possibly modified contents of the handled request out */ @@ -1657,6 +1658,20 @@ ixgbe_nvm_access_ioctl(struct ixgbe_softc *sc, struct ifdrv *ifd) goto cleanup_free_nvm_buffer; } + /* Convert private status to an error code for proper ioctl response */ + switch (status) { + case IXGBE_SUCCESS: + error = 0; + break; + case IXGBE_ERR_OUT_OF_RANGE: + error = ENOTTY; + break; + case IXGBE_ERR_PARAM: + default: + error = EINVAL; + break; + } + cleanup_free_nvm_buffer: free(nvm_buffer, M_IXGBE); return (error);