lkml.org 
[lkml]   [2022]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] module: Show the last unloaded module's taint flag(s)
On Sun, Jul 03, 2022 at 03:22:18PM +0100, Aaron Tomlin wrote:
> On Tue 2022-06-28 08:47 +0100, Aaron Tomlin wrote:
> > On Tue 2022-06-28 05:54 +0000, Christophe Leroy wrote:
> > > > - /* Store the name of the last unloaded module for diagnostic purposes */
> > > > strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
> > > > + strcat(last_unloaded_module, module_flags(mod, buf, false));
> > >
> > > You replace a bounded string copy by an unbounded strict contat.
> > >
> > > Should you use strlcat() instead ?
> >
> > Hi Christophe,
> >
> > Why? If I understand correctly, both the destination and source string are
> > NULL-terminated (see module_flags()). So, strcat() should be sufficient.
>
> Hi Luis,
>
> Any thoughts on this? As far as I can tell, the destination string cannot
> be overwritten; albeit, I can use the safer option if you prefer.

Yeah I don't like this as-is, it makes it not so easy to follow, I'll
reply in my review of your patch now.

Luis

\
 
 \ /
  Last update: 2022-07-07 01:34    [W:0.077 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site