Skip to contentSkip to conversation

sanitize audit_socketcall

PATCH In review Al Viro 2 participants 2 messages Dec 17, 2008

Subsystems (3)
lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 2/15 sanitize audit_socketcall

* don't bother with allocations
* now that it can't fail, make it return void

---
 include/linux/audit.h |    4 +-
 kernel/auditsc.c      |   66 ++++++++++++++++++++++++++++--------------------
 net/socket.c          |    4 +--
 3 files changed, 41 insertions(+), 33 deletions(-)
include/linux/audit.h +2 -2
index 8f0672d..e59feb9 100644
@@ -444,7 +444,7 @@ extern void audit_log_task_context(struct audit_buffer *ab);
 extern int __audit_ipc_obj(struct kern_ipc_perm *ipcp);
 extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode);
 extern int audit_bprm(struct linux_binprm *bprm);
-extern int audit_socketcall(int nargs, unsigned long *args);
+extern void audit_socketcall(int nargs, unsigned long *args);
 extern int audit_sockaddr(int len, void *addr);
 extern int __audit_fd_pair(int fd1, int fd2);
 extern int audit_set_macxattr(const char *name);
@@ -525,7 +525,7 @@ extern int audit_signals;
 #define audit_ipc_obj(i) ({ 0; })
 #define audit_ipc_set_perm(q,u,g,m) ({ 0; })
 #define audit_bprm(p) ({ 0; })
-#define audit_socketcall(n,a) ({ 0; })
+#define audit_socketcall(n,a) ((void)0)
 #define audit_fd_pair(n,a) ({ 0; })
 #define audit_sockaddr(len, addr) ({ 0; })
 #define audit_set_macxattr(n) do { ; } while (0)
kernel/auditsc.c +38 -28

114 lines not on this page · raw message

net/socket.c +1 -3
index 92764d8..aba5a50 100644
@@ -2066,9 +2066,7 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args)
 	if (copy_from_user(a, args, nargs[call]))
 		return -EFAULT;
 
-	err = audit_socketcall(nargs[call] / sizeof(unsigned long), a);
-	if (err)
-		return err;
+	audit_socketcall(nargs[call] / sizeof(unsigned long), a);
 
 	a0 = a[0];
 	a1 = a[1];
Signature · 1 line
1.5.6.5