[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240913234455.GA1842841@thelio-3990X>
Date: Fri, 13 Sep 2024 16:44:55 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Thorsten Blum <thorsten.blum@...lux.com>
Cc: kees@...nel.org, gustavoars@...nel.org,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
mcgrof@...nel.org, linux-hardening@...r.kernel.org,
linux-kernel@...r.kernel.org, Bill Wendling <morbo@...gle.com>
Subject: Re: [RESEND PATCH v2] params: Annotate struct module_param_attrs
with __counted_by()
On Sat, Sep 14, 2024 at 01:32:19AM +0200, Thorsten Blum wrote:
> Thanks for reporting this.
>
> Changing
>
> memset(&mk->mp->attrs[mk->mp->num - 1], 0, sizeof(mk->mp->attrs[0]));
>
> to
>
> memset(mk->mp->attrs + mk->mp->num - 1, 0, sizeof(mk->mp->attrs[0]));
>
> fixes the false-positive warning
>
> memset: detected buffer overflow: 32 byte write of buffer size 0
>
> even though the pointers have the same value. Does anyone know why?
Might be a good question for Bill? The full context is available
starting at:
https://lore.kernel.org/all/20240913164630.GA4091534@thelio-3990X/
I wonder if the krealloc() has something to do with it? I should try GCC
but I don't have a tip of tree copy handy at the moment and I am also
rushing at the end of my day to pack for my travels to LPC :)
Cheers,
Nathan
Powered by blists - more mailing lists