The patch titled Subject: linux/fs.h: move member alignment check next to definition of struct filename has been added to the -mm tree. Its filename is linux-fsh-move-member-alignment-check-next-to-definition-of-struct-filename.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/linux-fsh-move-member-alignment-check-next-to-definition-of-struct-filename.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/linux-fsh-move-member-alignment-check-next-to-definition-of-struct-filename.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> Subject: linux/fs.h: move member alignment check next to definition of struct filename Instead of doing this compile-time check in some slightly arbitrary user of struct filename, put it next to the definition. Link: http://lkml.kernel.org/r/20190208203015.29702-3-linux@xxxxxxxxxxxxxxxxxx Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> Cc: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx> Cc: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/namei.c | 2 -- include/linux/fs.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) --- a/fs/namei.c~linux-fsh-move-member-alignment-check-next-to-definition-of-struct-filename +++ a/fs/namei.c @@ -39,7 +39,6 @@ #include <linux/bitops.h> #include <linux/init_task.h> #include <linux/uaccess.h> -#include <linux/build_bug.h> #include "internal.h" #include "mount.h" @@ -131,7 +130,6 @@ getname_flags(const char __user *filenam struct filename *result; char *kname; int len; - BUILD_BUG_ON(offsetof(struct filename, iname) % sizeof(long) != 0); result = audit_reusename(filename); if (result) --- a/include/linux/fs.h~linux-fsh-move-member-alignment-check-next-to-definition-of-struct-filename +++ a/include/linux/fs.h @@ -37,6 +37,8 @@ #include <linux/uuid.h> #include <linux/errseq.h> #include <linux/ioprio.h> +#include <linux/build_bug.h> +#include <linux/stddef.h> #include <asm/byteorder.h> #include <uapi/linux/fs.h> @@ -2487,6 +2489,7 @@ struct filename { struct audit_names *aname; const char iname[]; }; +static_assert(offsetof(struct filename, iname) % sizeof(long) == 0); extern long vfs_truncate(const struct path *, loff_t); extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, _ Patches currently in -mm which might be from linux@xxxxxxxxxxxxxxxxxx are build_bugh-add-wrapper-for-_static_assert.patch lib-vsprintfc-move-sizeofstruct-printf_spec-next-to-its-definition.patch linux-fsh-move-member-alignment-check-next-to-definition-of-struct-filename.patch