aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xarray.c
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2021-05-18 03:16:57 +0000
committerKees Cook <[email protected]>2021-10-18 19:28:52 +0000
commit4797632f4f1d8af4e0670adcb97bf9800dc3beca (patch)
treed0c145b4b5ac8461f45a2dcf346945faaec8d080 /lib/xarray.c
parentlib: Introduce CONFIG_MEMCPY_KUNIT_TEST (diff)
downloadkernel-4797632f4f1d8af4e0670adcb97bf9800dc3beca.tar.gz
kernel-4797632f4f1d8af4e0670adcb97bf9800dc3beca.zip
string.h: Introduce memset_after() for wiping trailing members/padding
A common idiom in kernel code is to wipe the contents of a structure after a given member. This is especially useful in places where there is trailing padding. These open-coded cases are usually difficult to read and very sensitive to struct layout changes. Introduce a new helper, memset_after() that takes the target struct instance, the byte to write, and the member name after which the zeroing should start. Cc: Steffen Klassert <[email protected]> Cc: Herbert Xu <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Francis Laniel <[email protected]> Cc: Vincenzo Frascino <[email protected]> Cc: Daniel Axtens <[email protected]> Cc: [email protected] Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'lib/xarray.c')
0 files changed, 0 insertions, 0 deletions