diff --git a/fs/open.c b/fs/open.c index 0d63c94e1c5e..2f8845488798 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1361,6 +1361,8 @@ SYSCALL_DEFINE4(openat2, int, dfd, const char __user *, filename, if (unlikely(usize < OPEN_HOW_SIZE_VER0)) return -EINVAL; + if (unlikely(usize > PAGE_SIZE)) + return -E2BIG; err = copy_struct_from_user(&tmp, sizeof(tmp), how, usize); if (err)