Skip to content

Commit

Permalink
don't leak O_CLOEXEC into ->f_flags
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent ddd3e07 commit c6f3d81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o
op->mode = 0;

/* Must never be set by userspace */
flags &= ~FMODE_NONOTIFY;
flags &= ~FMODE_NONOTIFY & ~O_CLOEXEC;

/*
* O_SYNC is implemented as __O_SYNC|O_DSYNC. As many places only
Expand Down
2 changes: 1 addition & 1 deletion fs/proc/fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static int seq_show(struct seq_file *m, void *v)
if (file) {
struct fdtable *fdt = files_fdtable(files);

f_flags = file->f_flags & ~O_CLOEXEC;
f_flags = file->f_flags;
if (close_on_exec(fd, fdt))
f_flags |= O_CLOEXEC;

Expand Down

0 comments on commit c6f3d81

Please sign in to comment.