HIGH
scsi/target ConfigFS OOB
CVE-2026-46149
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
KernelScan AI5.3MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: scsi: target: configfs: Bound snprintf() return in tg_pt_gp_members_show() target_tg_pt_gp_members_show() formats LUN paths with snprintf() into a 256-byte stack buffer, then will memcpy() cur_len bytes from that buffer. snprintf() returns the length the output would have had, which can exceed the buffer size when the fabric WWN is long because iSCSI IQN names can be up to 223 bytes. The check at the memcpy() site only guards the destination page write, not the source read, so memcpy() will read past the stack buffer and copy adjacent stack contents to the sysfs reader, which when CONFIG_FORTIFY_SOURCE is enabled, fortify_panic() will be triggered. Commit 27e06650a5ea ("scsi: target: target_core_configfs: Add length check to avoid buffer overflow") added the same bound to the target_lu_gp_members_show() but the tg_pt_gp variant was missed so resolve that here.
02KernelScan AI Analysis
Risk summary
Systems with SCSI target subsystem configured and long iSCSI IQN names are at risk of kernel panic or stack memory disclosure when sysfs files are read. Requires root privileges to trigger but can cause denial of service through fortify_panic() when CONFIG_FORTIFY_SOURCE is enabled.
Vulnerability analysis
The target_tg_pt_gp_members_show() function incorrectly trusts snprintf() return value when copying from a fixed-size stack buffer to sysfs output. When iSCSI IQN names exceed buffer capacity, snprintf() returns the would-be length rather than actual bytes written, causing memcpy() to read past the 256-byte stack buffer and expose adjacent stack contents. The fix adds a bounds check to prevent reading beyond the buffer size, matching a similar fix applied to target_lu_gp_members_show() in an earlier commit.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 5.10 | 5.10.258 | d3cc9d490c20 |
| 5.15 | 5.15.209 | db0a4759d62c |
| 6.1 | 6.1.175 | 12f2201a5695 |
| 6.12 | 6.12.88 | 72cc5ea7ef32 |
| 6.18 | 6.18.30 | 00d91bfdce50 |
| 6.6 | 6.6.140 | 1f678d13e939 |
| 7.0 | 7.0.7 | e501154f9d82 |
| mainline | 7.1-rc3 | 772a896a56e0 |