Re: [PATCH RFC v2 18/25] kmsan: call KMSAN hooks where needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 2019-11-05 15:12:31, Alexander Potapenko wrote:
> On Fri, Nov 1, 2019 at 9:26 AM Sergey Senozhatsky
> <sergey.senozhatsky.work@xxxxxxxxx> wrote:
> >
> > On (19/10/31 12:49), Petr Mladek wrote:
> > >
> > > Please, separate the two comments with an empty line instead of using
> > > */ and /*.
> > >
> > > > +    * If any of vscnprintf() arguments is uninitialized, KMSAN will report
> > > > +    * one or more errors and also probably mark text_len as uninitialized.
> > > > +    * Initialize |text_len| to prevent the errors from spreading further.
> > > > +    */
> > > > +   text_len = KMSAN_INIT_VALUE(vscnprintf(text, sizeof(textbuf), fmt,
> > > > +                                          args));
> >
> > Or maybe this can be
> >
> >         text_len = vscnprintf(text, sizeof(textbuf), fmt, args);
> >  +      KMSAN_INIT_VALUE(text_len);
> This isn't how KMSAN_INIT_VALUE works. It takes a value that may be
> uninitialized and returns the same value marked as initialized.
> Shall I do:
>   text_len = KMSAN_INIT_VALUE(text_len);
> instead?

I like this. It nicely separates the KMSAN specific things.
Also the comment might be separate.

Best Regards,
Petr




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux