From: Kees Cook
> Sent: 11 April 2024 16:32
>
> On Wed, Apr 10, 2024 at 01:45:21PM -0700, Justin Stitt wrote:
> > On Tue, Apr 9, 2024 at 9:22 AM Kees Cook wrote:
> > > >
> > > > - /* 1 larger than sb_fname, so this ensures a trailing NUL char */
> > > > - memset(label, 0, sizeof(label));
On Wed, Apr 10, 2024 at 01:45:21PM -0700, Justin Stitt wrote:
> On Tue, Apr 9, 2024 at 9:22 AM Kees Cook wrote:
> > >
> > > - /* 1 larger than sb_fname, so this ensures a trailing NUL char */
> > > - memset(label, 0, sizeof(label));
> > > spin_lock(&mp->m_sb_lock);
> > > - strncp
On Tue, Apr 9, 2024 at 9:22 AM Kees Cook wrote:
> >
> > - /* 1 larger than sb_fname, so this ensures a trailing NUL char */
> > - memset(label, 0, sizeof(label));
> > spin_lock(&mp->m_sb_lock);
> > - strncpy(label, sbp->sb_fname, XFSLABEL_MAX);
> > + strscpy_pad(label, sbp->s
On Fri, Apr 05, 2024 at 07:52:27PM +, Justin Stitt wrote:
> strncpy() is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> The current code has taken care of NUL-termination by memset()'ing
> @lab
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.
The current code has taken care of NUL-termination by memset()'ing
@label. This is followed by a strncpy() to perform the string copy.
Instead,