public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: ChenXiaoSong <chenxiaosong@kylinos.cn>,
	"Paulo Alcantara (Red Hat)" <pc@manguebit.org>,
	Steve French <stfrench@microsoft.com>,
	Sasha Levin <sashal@kernel.org>,
	sfrench@samba.org, linux-cifs@vger.kernel.org,
	samba-technical@lists.samba.org
Subject: [PATCH AUTOSEL 6.18-6.1] smb/client: fix NT_STATUS_NO_DATA_DETECTED value
Date: Sun, 14 Dec 2025 19:41:19 -0500	[thread overview]
Message-ID: <20251215004145.2760442-2-sashal@kernel.org> (raw)
In-Reply-To: <20251215004145.2760442-1-sashal@kernel.org>

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

[ Upstream commit a1237c203f1757480dc2f3b930608ee00072d3cc ]

This was reported by the KUnit tests in the later patches.

See MS-ERREF 2.3.1 STATUS_NO_DATA_DETECTED. Keep it consistent with the
value in the documentation.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

## Analysis of Commit: smb/client: fix NT_STATUS_NO_DATA_DETECTED value

### 1. COMMIT MESSAGE ANALYSIS
- Subject clearly states "fix" indicating a bug fix
- References MS-ERREF 2.3.1 (Microsoft's official NTSTATUS
  documentation) as the authoritative source
- Bug was discovered through KUnit tests
- Has Acked-by from Paulo Alcantara (Red Hat SMB maintainer) and Signed-
  off-by from Steve French (primary SMB/CIFS maintainer)

### 2. CODE CHANGE ANALYSIS

The change is a single-line fix in a header file:
```c
-#define NT_STATUS_NO_DATA_DETECTED 0x8000001c
+#define NT_STATUS_NO_DATA_DETECTED 0x80000022
```

**Critical bug identified**: The OLD value `0x8000001c` was
**duplicated** with another constant defined just a few lines above:
```c
#define NT_STATUS_MEDIA_CHANGED    0x8000001c
```

This is clearly a bug - two distinct Windows NT error status codes were
sharing the same numeric value. This would cause:
- Incorrect error code interpretation when servers return
  STATUS_NO_DATA_DETECTED (0x80000022)
- Potential confusion between STATUS_MEDIA_CHANGED and
  STATUS_NO_DATA_DETECTED

The new value `0x80000022` matches the official Microsoft MS-ERREF
specification for STATUS_NO_DATA_DETECTED.

### 3. CLASSIFICATION
- **Bug fix**: Yes - corrects a provably incorrect constant value
- **Feature addition**: No
- **New API**: No
- **Specification compliance fix**: Aligns with official Microsoft
  documentation

### 4. SCOPE AND RISK ASSESSMENT
- **Size**: 1 line changed
- **Files**: 1 header file
- **Risk**: Extremely low - simply correcting a wrong numeric constant
- **Subsystem**: SMB client (commonly used for network file sharing)

This is about as low-risk as a fix can get - it's correcting a single
constant value to match official documentation. The previous value was
demonstrably wrong (duplicate of another constant).

### 5. USER IMPACT
SMB is widely used for file sharing across networks. Having correct
error status codes is important for proper error handling. While the
practical impact depends on how this constant is used, having correct
protocol constants is essential for interoperability.

### 6. STABILITY INDICATORS
- Acked by Red Hat's SMB maintainer
- Signed off by the primary CIFS/SMB maintainer (Steve French)
- KUnit tests caught this issue, indicating testing coverage

### 7. DEPENDENCY CHECK
- No dependencies on other commits
- Standalone fix to a header constant
- SMB client code exists in stable trees

### Summary

**Meets stable criteria:**
- ✅ Obviously correct (matches official MS-ERREF documentation)
- ✅ Fixes a real bug (duplicate constant value)
- ✅ Extremely small and contained (single line change)
- ✅ No new features or APIs
- ✅ Low risk (just correcting a constant value)

**Risk vs Benefit:**
- Risk: Minimal - changing a constant to its documented correct value
- Benefit: Correct SMB error handling, protocol compliance

This is a textbook example of a safe stable backport candidate: an
obviously wrong value is corrected to match official documentation, the
change is tiny, and there's no possibility of regression since the old
value was demonstrably incorrect (it was a duplicate of
NT_STATUS_MEDIA_CHANGED).

**YES**

 fs/smb/client/nterr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/smb/client/nterr.h b/fs/smb/client/nterr.h
index b3516c71cff77..09263c91d07a4 100644
--- a/fs/smb/client/nterr.h
+++ b/fs/smb/client/nterr.h
@@ -41,7 +41,7 @@ extern const struct nt_err_code_struct nt_errs[];
 #define NT_STATUS_MEDIA_CHANGED    0x8000001c
 #define NT_STATUS_END_OF_MEDIA     0x8000001e
 #define NT_STATUS_MEDIA_CHECK      0x80000020
-#define NT_STATUS_NO_DATA_DETECTED 0x8000001c
+#define NT_STATUS_NO_DATA_DETECTED 0x80000022
 #define NT_STATUS_STOPPED_ON_SYMLINK 0x8000002d
 #define NT_STATUS_DEVICE_REQUIRES_CLEANING 0x80000288
 #define NT_STATUS_DEVICE_DOOR_OPEN 0x80000289
-- 
2.51.0


  reply	other threads:[~2025-12-15  0:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15  0:41 [PATCH AUTOSEL 6.18-6.17] ALSA: hda/realtek: Add support for ASUS UM3406GA Sasha Levin
2025-12-15  0:41 ` Sasha Levin [this message]
2025-12-15  0:41 ` [PATCH AUTOSEL 6.18-6.17] ALSA: hda: intel-dsp-config: Prefer legacy driver as fallback Sasha Levin
2025-12-15 23:29   ` Askar Safin
2026-01-07 11:16     ` Sasha Levin
2026-01-11 12:04       ` Askar Safin
2026-01-11 12:24         ` Greg KH
2026-01-11 16:01           ` Askar Safin
2026-01-12 10:54             ` Greg KH
2026-01-15 14:34               ` [PATCH 6.12.y] " Askar Safin
2026-01-15 14:40               ` [PATCH AUTOSEL 6.18-6.17] " Askar Safin
2025-12-15  0:41 ` [PATCH AUTOSEL 6.18-6.12] ASoC: rockchip: Fix Wvoid-pointer-to-enum-cast warning (again) Sasha Levin
2025-12-15  0:41 ` [PATCH AUTOSEL 6.18-5.10] NFSv4: ensure the open stateid seqid doesn't go backwards Sasha Levin
2025-12-15  0:41 ` [PATCH AUTOSEL 6.18-6.1] bcache: fix improper use of bi_end_io Sasha Levin
2025-12-15  0:41 ` [PATCH AUTOSEL 6.18-5.10] NFS: Fix up the automount fs_context to use the correct cred Sasha Levin
2025-12-15  0:41 ` [PATCH AUTOSEL 6.18-6.1] smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value Sasha Levin
2025-12-15  0:41 ` [PATCH AUTOSEL 6.18-6.1] smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value Sasha Levin
2025-12-15  0:41 ` [PATCH AUTOSEL 6.18-6.12] drm/amd/display: shrink struct members Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251215004145.2760442-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=chenxiaosong@kylinos.cn \
    --cc=linux-cifs@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=pc@manguebit.org \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    --cc=stable@vger.kernel.org \
    --cc=stfrench@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox