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] [thread-next>] [day] [month] [year] [list]
Date: Thu, 28 Mar 2024 13:42:15 -0700
From: Justin Stitt <justinstitt@...gle.com>
To: Baoquan He <bhe@...hat.com>
Cc: Vivek Goyal <vgoyal@...hat.com>, Dave Young <dyoung@...hat.com>, kexec@...ts.infradead.org, 
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org, 
	linux-hardening@...r.kernel.org
Subject: Re: [PATCH] vmcore: replace strncpy with strtomem

Hi,

On Wed, Mar 27, 2024 at 6:48 PM Baoquan He <bhe@...hat.com> wrote:
> > Mark these buffers as __nonstring and use strtomem_pad.
>
> Thanks.
>
> I didn't build, wondering if '__nonstring' has to be set so that
> strtomem_pad() can be used.

I do not believe marking buffers as __nonstring is strictly a
requirement. However, the documentation from string.h +302 says we
should do it:
/**
 * strtomem_pad - Copy NUL-terminated string to non-NUL-terminated buffer
 *
 * @dest: Pointer of destination character array (marked as __nonstring)
...

and so does [1] ... "mark the destination buffer variable (or
structure member) with the __nonstring attribute..."

FWIW, this builds just fine without the __nonstring attribute but we
should use it :)

>
> Thanks
> Baoquan
>

[1] https://github.com/KSPP/linux/issues/90

Thanks
Justin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ