diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-02-17 12:26:14 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-02-17 12:26:14 +1100 |
commit | addc481a295080ead4f09495a50edfedc1b7db7b (patch) | |
tree | 55093c1e3e390ccdae5ca94dbed131a6ab15ab18 /net | |
parent | 87b5e13aba208ff50062c8c34fb1a905efeef483 (diff) | |
parent | fe8e52b9b9100c486051aaf5208dbf4072bb87b1 (diff) |
Merge remote-tracking branch 'audit/next'
Diffstat (limited to 'net')
-rw-r--r-- | net/compat.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/net/compat.c b/net/compat.c index ba3ac722714d..aba929e5250f 100644 --- a/net/compat.c +++ b/net/compat.c @@ -22,6 +22,7 @@ #include <linux/filter.h> #include <linux/compat.h> #include <linux/security.h> +#include <linux/audit.h> #include <linux/export.h> #include <net/scm.h> @@ -782,14 +783,24 @@ COMPAT_SYSCALL_DEFINE5(recvmmsg, int, fd, struct compat_mmsghdr __user *, mmsg, COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args) { - int ret; - u32 a[6]; + u32 a[AUDITSC_ARGS]; + unsigned int len; u32 a0, a1; + int ret; if (call < SYS_SOCKET || call > SYS_SENDMMSG) return -EINVAL; - if (copy_from_user(a, args, nas[call])) + len = nas[call]; + if (len > sizeof(a)) + return -EINVAL; + + if (copy_from_user(a, args, len)) return -EFAULT; + + ret = audit_socketcall_compat(len / sizeof(a[0]), a); + if (ret) + return ret; + a0 = a[0]; a1 = a[1]; |