[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202404110829.D3A5A56@keescook>
Date: Thu, 11 Apr 2024 08:31:34 -0700
From: Kees Cook <keescook@...omium.org>
To: Justin Stitt <justinstitt@...gle.com>
Cc: Chandan Babu R <chandan.babu@...cle.com>,
"Darrick J. Wong" <djwong@...nel.org>, linux-xfs@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] xfs: replace deprecated strncpy with strscpy_pad
On Wed, Apr 10, 2024 at 01:45:21PM -0700, Justin Stitt wrote:
> On Tue, Apr 9, 2024 at 9:22 AM Kees Cook <keescook@...omium.org> 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->sb_fname);
> >
> > Is sbp->sb_fname itself NUL-terminated? This looks like another case of
> > needing the memtostr() helper?
> >
>
> I sent a patch [1].
>
> Obviously it depends on your implementation patch landing first; what
> tree should it go to?
This "flavor" of conversion may need to wait a release? There's no
urgency on the conversion, and there are plenty more to do for this
cycle. ;)
-Kees
> [1]: https://lore.kernel.org/r/20240410-strncpy-xfs-split1-v2-1-7c651502bcb0@google.com
--
Kees Cook
Powered by blists - more mailing lists