From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH] scsi: target: configfs: bound snprintf return in tg_pt_gp_members_show
Date: Mon, 13 Apr 2026 22:44:26 -0400 [thread overview]
Message-ID: <yq17bqatg5f.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <2026041159-garter-theft-3be0@gregkh> (Greg Kroah-Hartman's message of "Sat, 11 Apr 2026 14:06:00 +0200")
Greg,
> 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.
Applied to 7.1/scsi-staging, thanks!
--
Martin K. Petersen
prev parent reply other threads:[~2026-04-14 2:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-11 12:06 [PATCH] scsi: target: configfs: bound snprintf return in tg_pt_gp_members_show Greg Kroah-Hartman
2026-04-14 2:44 ` Martin K. Petersen [this message]
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=yq17bqatg5f.fsf@ca-mkp.ca.oracle.com \
--to=martin.petersen@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=target-devel@vger.kernel.org \
/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