diff --git a/fs/open.c b/fs/open.c index c767963d1..5b10dd1cc 100755 --- a/fs/open.c +++ b/fs/open.c @@ -1302,6 +1302,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)