Hi Andy, > Date: 2026-11-13 16:34:13+0200 > From: Andy Shevchenko > > On Fri, Nov 13, 2026 at 04:33:37PM +0200, Andy Shevchenko wrote: > > On Fri, Nov 13, 2026 at 02:10:29PM +0100, Alejandro Colomar wrote: > > > As Bartosz reported, str_has_prefix() has a bug: it can't differentiate > > > between an empty prefix matching an empty string from a non-matching > > > prefix. This is a fundamental design flaw in this API, and not > > > something that can be fixed. > > > > > > As always, this is a consequence of choosing sizes instead of pointers. > > > Sizes are often the wrong choice. In this specific case, pointers are > > > more capable of differentiating these cases, as NULL is a special > > > sentinel value that doesn't need to overload a valid value. > > > > > > Let's implement strprefix(), a function that returns a pointer > > > right after the prefix if found, and a null pointer if not found. > > > > > > We'll slowly migrate existing code from str_has_prefix() to strprefix(). > > > > > > Move the description from str_has_prefix(), and describe > > > str_has_prefix() by comparing it to strprefix(). > > > > > > Reported-by: Bartosz Golaszewski > > > Link: https://lore.kernel.org/linux-hardening/20261104-fwnode-for-each-prop-v1-1-6e28fe1c72c4@oss.qualcomm.com/ > > > It's unreferred Link tag, spurious? Please, refer to it in the commit message > > to understand why it's here. Use Link: $URL [1] and use [1] in the text. > > Ah, perhaps you wanted Closes tag instead? Yeah, it was for linking to Bart's report. BTW, is it okay to have two consecutive patches with the same Closes tag? I guess it is, because they close different aspects of the same issue. But at the same time, the first one doesn't fully close the link. I guess yeah, I should just put it in both. Thanks! Cheers, Alex --