From nobody Mon Nov 16 21:00:43 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 4jT0d80Bcfz70wfX for ; Mon, 16 Nov 2026 21:00:44 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jT0d759ZBz4Ck2 for ; Mon, 16 Nov 2026 21:00:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794862843; 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=IJm/QNQTnEGRGGvaBqWD/vEfJ4/q/Jsx8kQHrG5ramE=; b=r9xNyDkEPP28L5vtVn1IDK+c1Df4k28EpnmrqazrQm+daDtLwH57CWfuCqKtsPcsp50WwJ ShD0AeKzLszi0O8rvoZjaD4kFrDReGq9vsQgXlL8sA4pqsLCH/M0c9VntkF6jiGFinj4Qk CXbz43eJbMK7smuDFbOTaW/EklDHSZ0QnKM03NQ8craLDfiY/wU2bBMzTgni55SG4dkEFO WSutqz+rsdSmgkRgBaOvpqVvzOHUkHtgJ2TQU1powHKgl5gbfIm3DNJAGh+lyPGWbLfrwg 3dc6l6Q1BkW2io/iMzeY3tfPv8p9GbjDCmdczmv24zEClGX9Q5+qIrqOQikCTw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794862843; b=U+IJ2P2Uc262QtZM8zwoIUHiXc8EufydsDs+/cq1CP7RunzLEW8CF/mQHU8tHV6VUYJoKQ nFLJpFmfZarGh2sZYXvNRZGtT9u0zcn/PPbAdFQ+FTWqMjjSzChuvtJEKqLnw7x3r9Ww8R fnaLnJHp8Xx9mDsUg/5U74LSF6IiB8H7OHeI9zrHt8gr8GQWqC82O8ThF1uA/ln1z86r+L ZyET1HQi0nkTi0i9uzNtK0lzjycm82Lbxuua1gcACfhi+aGbZ3xVtiEq+j/FGoP40WFl5Q VSYj2CaBnIKCOLtmZ7anlJo/xo0YUEfEJ/7LDPk+txPQDTFrbCMCEiSSyD6CTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794862843; 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=IJm/QNQTnEGRGGvaBqWD/vEfJ4/q/Jsx8kQHrG5ramE=; b=GIxbPRVt9utX4D0PC33dBElEBgi/W0F79oeOuv03GGyCJczT9wkUePUy8jrolOSKE1/7jD FRBaSyeW7tf3kFHUfUMrpVsa6UkSpt2QjRRJFFRehlOXhNkvroPs/upo1XmEKscGHzzWb2 3ENJwE3hHiBJbpXlKSpJa5NeAYWCkqEdXqe31EqOySOECmMXFzudAj5L9SSPA5OHPf9zRZ mu1CRW+DidrlIuvUQa0bO3+OfexggL3bBED2h35d8YensUqFLGVOw1aiNnIR/di+/qSJtm k2g53cnfWOLtrsrJmLAtG30Jpv9sEFnlJctpxPp/PoASy20SfyzR3z8+UVzUmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jT0d746L4z19Z0 for ; Mon, 16 Nov 2026 21:00:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 9cee by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 16 Nov 2026 21:00:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kenneth D. Merry Subject: git: bc7453beb4f5 - stable/15 - camcontrol: Fix swapped protection information defaults in nvformat List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository 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: ken X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: bc7453beb4f51a312241ec286b09b7122d49f461 Auto-Submitted: auto-generated Date: Mon, 16 Nov 2026 21:00:43 +0000 Message-Id: <6afb6efb.9cee.69e6ea7b@gitrepo.freebsd.org> The branch stable/15 has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=bc7453beb4f51a312241ec286b09b7122d49f461 commit bc7453beb4f51a312241ec286b09b7122d49f461 Author: Kenneth D. Merry AuthorDate: 2026-11-09 18:46:59 +0000 Commit: Kenneth D. Merry CommitDate: 2026-11-16 16:12:42 +0000 camcontrol: Fix swapped protection information defaults in nvformat When no -p or -l arguments are given, the nvformat subcommand fills in the protection information type and location from the namespace's current settings. The two were swapped: pi was taken from the DPS metadata location bit and pil from the protection information type field. Formatting a namespace with protection information enabled would therefore silently change its PI settings, and before the Format NVM command builder masked its fields, a namespace with PI type 2 enabled would set bit 9 of cdw10, turning the format into a user data erase. Reported by: llm-postcr Fixes: 80f090111ae4 MFC after: 1 week Sponsored by: Spectra Logic Co-authored-by: Claude Fable 5 (cherry picked from commit ef69484b4295e84c74877b439db5caf025906b0c) --- sbin/camcontrol/nvformat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/camcontrol/nvformat.c b/sbin/camcontrol/nvformat.c index a41b490d62bc..777035812e6b 100644 --- a/sbin/camcontrol/nvformat.c +++ b/sbin/camcontrol/nvformat.c @@ -232,12 +232,12 @@ nvmeformat(struct cam_device *device, int argc, char **argv, char *combinedopt, & NVME_NS_DATA_FLBAS_EXTENDED_MASK; } if (pi < 0) { - pi = (nsdata.dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) - & NVME_NS_DATA_DPS_MD_START_MASK; + pi = (nsdata.dps >> NVME_NS_DATA_DPS_PIT_SHIFT) & + NVME_NS_DATA_DPS_PIT_MASK; } if (pil < 0) { - pil = (nsdata.dps >> NVME_NS_DATA_DPS_PIT_SHIFT) & - NVME_NS_DATA_DPS_PIT_MASK; + pil = (nsdata.dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) + & NVME_NS_DATA_DPS_MD_START_MASK; } if (ses < 0) ses = 0;