summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2017-02-09 13:45:54 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2017-02-09 13:45:54 +1100
commitda71fa45e038c1091eb70566354258575610502a (patch)
tree7ec8e62f74050a4b12cd889a0debf629a1e8050a /net
parentc2f84dc1815ee05e96c156730ac3d389d63de96a (diff)
parent62bc306e2083436675e33b5bdeb6a77907d35971 (diff)
Merge remote-tracking branch 'audit/next'
Diffstat (limited to 'net')
-rw-r--r--net/compat.c17
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];