Cc'ing Kees. On Thu, Apr 4, 2024 at 3:33 PM James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> wrote: > But additionally this is a common pattern in SCSI: using strncpy to > zero terminate fields that may be unterminated in the exchange protocol > so we can send them to sysfs or otherwise treat them as strings. That > means we might have this problem in other drivers you've converted ... Correct. Although certain conditions must be met: 1) length argument is larger than source but less than or equal to destination 2) source is not NUL-terminated 3) sizes known at compile-time I think fortified strscpy needs to be a bit more lenient towards source buffer overreads when we know strscpy should just truncate and NUL-terminate. Kees, what do you think? > > James > >