mirror-linux/drivers/md/bcache
Kees Cook 016dadc60e bcache: Silence memcpy() run-time false positive warnings
[ Upstream commit be0d8f48ad ]

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)
  memcpy: detected field-spanning write (size 24) of single field "&temp.key" at drivers/md/bcache/extents.c:428 (size 16)

Reported-by: Alexandre Pereira <alexpereira@disroot.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216785
Acked-by: Coly Li <colyli@suse.de>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Cc: linux-bcache@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230106060229.never.047-kees@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-09 11:28:14 +01:00
..
Kconfig bcache: remove EXPERIMENTAL for Kconfig option 'Asynchronous device registration' 2022-08-02 17:22:41 -06:00
Makefile
alloc.c
bcache.h bcache:: fix repeated words in comments 2022-09-19 11:12:35 -06:00
bcache_ondisk.h bcache: Silence memcpy() run-time false positive warnings 2023-02-09 11:28:14 +01:00
bset.c bcache: bset: Fix comment typos 2022-09-19 11:12:35 -06:00
bset.h
btree.c mm: shrinkers: provide shrinkers with names 2022-07-03 18:08:40 -07:00
btree.h
closure.c
closure.h
debug.c
debug.h
extents.c
extents.h
features.c
features.h
io.c
journal.c bcache: Silence memcpy() run-time false positive warnings 2023-02-09 11:28:14 +01:00
journal.h bcache: avoid journal no-space deadlock by reserving 1 journal bucket 2022-05-24 06:19:33 -06:00
movinggc.c
request.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
request.h
stats.c
stats.h bcache: remove unused bch_mark_cache_readahead function def in stats.h 2022-09-19 11:12:35 -06:00
super.c md/bcache: Combine two prio_io() arguments 2022-07-14 12:14:31 -06:00
sysfs.c
sysfs.h
trace.c
util.c
util.h
writeback.c bcache: fix set_at_max_writeback_rate() for multiple attached devices 2022-09-19 11:12:35 -06:00
writeback.h bcache: improve multithreaded bch_sectors_dirty_init() 2022-05-24 06:19:33 -06:00