aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2007-02-07 01:48:00 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2007-02-17 21:30:15 -0500
commitdb3495099d3d52854b13874905af6e40a91f4721 (patch)
tree5a832081d70dd9dabda3498baf40b7d6ced47f24 /fs
parent6a01b07fae482f9b34491b317056c89d3b96ca2e (diff)
downloadkernel_samsung_espresso10-db3495099d3d52854b13874905af6e40a91f4721.zip
kernel_samsung_espresso10-db3495099d3d52854b13874905af6e40a91f4721.tar.gz
kernel_samsung_espresso10-db3495099d3d52854b13874905af6e40a91f4721.tar.bz2
[PATCH] AUDIT_FD_PAIR
Provide an audit record of the descriptor pair returned by pipe() and socketpair(). Rewritten from the original posted to linux-audit by John D. Ramsdell <ramsdell@mitre.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/pipe.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index 68090e8..ebafde7 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -16,6 +16,7 @@
#include <linux/uio.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
+#include <linux/audit.h>
#include <asm/uaccess.h>
#include <asm/ioctls.h>
@@ -985,6 +986,10 @@ int do_pipe(int *fd)
goto err_fdr;
fdw = error;
+ error = audit_fd_pair(fdr, fdw);
+ if (error < 0)
+ goto err_fdw;
+
fd_install(fdr, fr);
fd_install(fdw, fw);
fd[0] = fdr;
@@ -992,6 +997,8 @@ int do_pipe(int *fd)
return 0;
+ err_fdw:
+ put_unused_fd(fdw);
err_fdr:
put_unused_fd(fdr);
err_read_pipe: