[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <0eae0209607cd5b6e302676779e1de55f6bc6e61.1484224437.git.rgb@redhat.com>
Date: Thu, 12 Jan 2017 07:36:45 -0500
From: Richard Guy Briggs <rgb@...hat.com>
To: linux-kernel@...r.kernel.org, linux-audit@...hat.com
Cc: Richard Guy Briggs <rgb@...hat.com>,
Kangkook Jee <aixer77@...il.com>,
Eric Paris <eparis@...hat.com>, Paul Moore <pmoore@...hat.com>,
Steve Grubb <sgrubb@...hat.com>
Subject: [RFC] [PATCH] audit: log 32-bit socketcalls
32-bit socketcalls were not being logged by audit on x86_64 systems.
Log them.
See: https://github.com/linux-audit/audit-kernel/issues/14
Signed-off-by: Richard Guy Briggs <rgb@...hat.com>
---
net/compat.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/net/compat.c b/net/compat.c
index 1cd2ec0..86cacab 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>
@@ -781,14 +782,27 @@ COMPAT_SYSCALL_DEFINE5(recvmmsg, int, fd, struct compat_mmsghdr __user *, mmsg,
COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args)
{
+ unsigned int len, i;
int ret;
- u32 a[6];
+ u32 a[AUDITSC_ARGS];
+ unsigned long aa[AUDITSC_ARGS];
u32 a0, a1;
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;
+
+ for (i=0; i < len/sizeof(a[0]); i++)
+ aa[i] = (unsigned long)a[i];
+ ret = audit_socketcall(len/sizeof(a[0]), aa);
+ if (ret)
+ return ret;
+
a0 = a[0];
a1 = a[1];
--
1.7.1
Powered by blists - more mailing lists