Loading fs/open.c +2 −0 Original line number Original line Diff line number Diff line Loading @@ -844,6 +844,8 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o if ((flags & O_TMPFILE_MASK) != O_TMPFILE) if ((flags & O_TMPFILE_MASK) != O_TMPFILE) return -EINVAL; return -EINVAL; acc_mode = MAY_OPEN | ACC_MODE(flags); acc_mode = MAY_OPEN | ACC_MODE(flags); if (!(acc_mode & MAY_WRITE)) return -EINVAL; } else if (flags & O_PATH) { } else if (flags & O_PATH) { /* /* * If we have O_PATH in the open flag. Then we * If we have O_PATH in the open flag. Then we Loading include/uapi/asm-generic/fcntl.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -89,8 +89,8 @@ #endif #endif /* a horrid kludge trying to make sure that this will fail on old kernels */ /* a horrid kludge trying to make sure that this will fail on old kernels */ #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY | O_RDWR) #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) #define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT | O_ACCMODE) #define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT) #ifndef O_NDELAY #ifndef O_NDELAY #define O_NDELAY O_NONBLOCK #define O_NDELAY O_NONBLOCK Loading Loading
fs/open.c +2 −0 Original line number Original line Diff line number Diff line Loading @@ -844,6 +844,8 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o if ((flags & O_TMPFILE_MASK) != O_TMPFILE) if ((flags & O_TMPFILE_MASK) != O_TMPFILE) return -EINVAL; return -EINVAL; acc_mode = MAY_OPEN | ACC_MODE(flags); acc_mode = MAY_OPEN | ACC_MODE(flags); if (!(acc_mode & MAY_WRITE)) return -EINVAL; } else if (flags & O_PATH) { } else if (flags & O_PATH) { /* /* * If we have O_PATH in the open flag. Then we * If we have O_PATH in the open flag. Then we Loading
include/uapi/asm-generic/fcntl.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -89,8 +89,8 @@ #endif #endif /* a horrid kludge trying to make sure that this will fail on old kernels */ /* a horrid kludge trying to make sure that this will fail on old kernels */ #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY | O_RDWR) #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) #define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT | O_ACCMODE) #define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT) #ifndef O_NDELAY #ifndef O_NDELAY #define O_NDELAY O_NONBLOCK #define O_NDELAY O_NONBLOCK Loading