lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 11 Jan 2022 17:14:40 +0100
From:   Rasmus Villemoes <linux@...musvillemoes.dk>
To:     Petr Mladek <pmladek@...e.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
        Sergey Senozhatsky <senozhatsky@...omium.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>
Subject: Re: [PATCH v1 1/1] vsprintf: Move space out of string literals in
 fourcc_string()

On 11/01/2022 16.10, Petr Mladek wrote:
> On Tue 2022-01-11 13:28:21, Andy Shevchenko wrote:

>>>> -	strcpy(p, orig & BIT(31) ? " big-endian" : " little-endian");
>>>> +	*p++ = ' ';
>>>> +	strcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
>>>>  	p += strlen(p);
>>>
>>> Hm, ok, those two strings do occur a lot with of_property_read_bool()
>>> and friends. But if you're micro-optimizing anyway, why not drop the
>>> strlen() and say p = stpcpy(...) instead?
>>
>> Why not? I'll do it for v2.
> 
> It is safe here. I just hope that it will not trigger reports from
> some tools looking for potential security issues ;-)
> 

strcpy() and stpcpy() have exactly the same preconditions and are safe
in exactly the same circumstances, they only differ in their return
value, so I don't see how any tool would warn about a use of (the
only-recently-standardized) stpcpy if it didn't already warn about strcpy.

Rasmus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ