]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.11.6/vfs-allow-o_path-file-descriptors-for-fstatfs.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.11.6 / vfs-allow-o_path-file-descriptors-for-fstatfs.patch
CommitLineData
9ae184f0
GKH
1From 9d05746e7b16d8565dddbe3200faa1e669d23bbf Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Mon, 30 Sep 2013 08:35:10 -0700
4Subject: vfs: allow O_PATH file descriptors for fstatfs()
5
6From: Linus Torvalds <torvalds@linux-foundation.org>
7
8commit 9d05746e7b16d8565dddbe3200faa1e669d23bbf upstream.
9
10Olga reported that file descriptors opened with O_PATH do not work with
11fstatfs(), found during further development of ksh93's thread support.
12
13There is no reason to not allow O_PATH file descriptors here (fstatfs is
14very much a path operation), so use "fdget_raw()". See commit
1555815f70147d ("vfs: make O_PATH file descriptors usable for 'fstat()'")
16for a very similar issue reported for fstat() by the same team.
17
18Reported-and-tested-by: ольга крыжановская <olga.kryzhanovska@gmail.com>
19Acked-by: Al Viro <viro@zeniv.linux.org.uk>
20Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23---
24 fs/statfs.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27--- a/fs/statfs.c
28+++ b/fs/statfs.c
29@@ -94,7 +94,7 @@ retry:
30
31 int fd_statfs(int fd, struct kstatfs *st)
32 {
33- struct fd f = fdget(fd);
34+ struct fd f = fdget_raw(fd);
35 int error = -EBADF;
36 if (f.file) {
37 error = vfs_statfs(&f.file->f_path, st);