[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <132043f4-d19a-911d-04c4-a24fdf89153f@leemhuis.info>
Date: Fri, 6 Jan 2023 11:01:05 +0100
From: Thorsten Leemhuis <linux@...mhuis.info>
To: Kees Cook <keescook@...omium.org>, Coly Li <colyli@...e.de>
Cc: Kent Overstreet <kent.overstreet@...il.com>,
linux-bcache@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] bcache: Silence memcpy() run-time false positive warnings
On 06.01.23 07:02, Kees Cook wrote:
> struct bkey has internal padding in a union, but it isn't always named
> the same (e.g. key ## _pad, key_p, etc). This makes it extremely hard
> for the compiler to reason about the available size of copies done
> against such keys. Use unsafe_memcpy() for now, to silence the many
> run-time false positive warnings:
>
> memcpy: detected field-spanning write (size 264) of single field "&i->j" at drivers/md/bcache/journal.c:152 (size 240)
> memcpy: detected field-spanning write (size 24) of single field "&b->key" at drivers/md/bcache/btree.c:939 (size 16)
> emcpy: detected field-spanning write (size 24) of single field "&temp.key" at drivers/md/bcache/extents.c:428 (size 16)
Thx for looking into this.
> Reported-by: Thorsten Leemhuis <linux@...mhuis.info>
> Link: https://lore.kernel.org/all/19200730-a3ba-6f4f-bb81-71339bdbbf73@leemhuis.info/
Credit where credit is due, this should be:
Reported-by: Alexandre Pereira <alexpereira@...root.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216785
> Cc: Coly Li <colyli@...e.de>
> […]
Ciao, Thorsten
Powered by blists - more mailing lists