Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Unverified Commit f91f0117 authored by Kees Cook's avatar Kees Cook Committed by basamaryan
Browse files

UPSTREAM: stddef.h: Introduce sizeof_field()



The size of fields within a structure is needed in a few places in the
kernel already, and will be needed for the usercopy whitelisting when
declaring whitelist regions within structures. This creates a dedicated
macro and redefines offsetofend() to use it.

Existing usage, ignoring the 1200+ lustre assert uses:

$ git grep -E 'sizeof\(\(\((struct )?[a-zA-Z_]+ \*\)0\)->' | \
	grep -v staging/lustre | wc -l
65

Change-Id: I68f46fefe29fb6c9dfe358717a343e108f797d81
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent 993b4218
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment