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]
Message-ID: <20221214225402.GA16409@ranerica-svr.sc.intel.com>
Date:   Wed, 14 Dec 2022 14:54:02 -0800
From:   Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To:     "Luck, Tony" <tony.luck@...el.com>
Cc:     "yang.yang29@....com.cn" <yang.yang29@....com.cn>,
        "bp@...en8.de" <bp@...en8.de>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "x86@...nel.org" <x86@...nel.org>, "hpa@...or.com" <hpa@...or.com>,
        "linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "xu.panda@....com.cn" <xu.panda@....com.cn>
Subject: Re: [PATCH linux-next] x86/mce/dev-mcelog: use strscpy() to instead
 of strncpy()

On Wed, Dec 14, 2022 at 09:29:59PM +0000, Luck, Tony wrote:
> >> The implementation of strscpy() is more robust and safer.
> >> That's now the recommended way to copy NUL terminated strings.
> >
> > It should read "NULL-terminated strings".
> 
> Both "NUL-terminated" and "NULL-terminated" seem to be used in the kernel
> source and commit comments.  NULL is ahead 124:45 in the source, but it
> is closer in the commit logs where the ratio is 129:76.
> 
> Single "L" NUL seems technically more accurate as the string terminator is
> an ascii NUL character. From man 5 ascii the character name is NUL (though
> the description says "null" to muddy the waters)
> 
>        Oct   Dec   Hex   Char
>        ───────────────────────────────────────────
>        000   0     00    NUL '\0' (null character)

Thanks for the analysis Tony. Indeed, I agree that "NUL-terminated" is
more accurate.

Thanks and BR,
Ricardo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ