linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] btrfs: don't allow trans ioctl on a directory
@ 2017-07-21 17:29 josef
  2017-07-21 17:29 ` [PATCH 2/3] btrfs: fix readdir deadlock with pagefault josef
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: josef @ 2017-07-21 17:29 UTC (permalink / raw)
  To: linux-btrfs, kernel-team; +Cc: Josef Bacik

From: Josef Bacik <jbacik@fb.com>

We need to use file->private_data for readdir on directories, so just
don't allow user space transactions on directories.

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 fs/btrfs/ioctl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index bedeec6..ddb3811 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3968,6 +3968,9 @@ static long btrfs_ioctl_trans_start(struct file *file)
 	struct btrfs_trans_handle *trans;
 	int ret;
 
+	if (S_ISDIR(inode->i_mode))
+		return -EINVAL;
+
 	ret = -EPERM;
 	if (!capable(CAP_SYS_ADMIN))
 		goto out;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-07-24 16:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-21 17:29 [PATCH 1/3] btrfs: don't allow trans ioctl on a directory josef
2017-07-21 17:29 ` [PATCH 2/3] btrfs: fix readdir deadlock with pagefault josef
2017-07-21 19:10   ` Josef Bacik
2017-07-24  8:26   ` Nikolay Borisov
2017-07-24 13:59     ` Josef Bacik
2017-07-24 12:50   ` David Sterba
2017-07-24 13:14     ` David Sterba
2017-07-24 14:01       ` Josef Bacik
2017-07-21 17:29 ` [PATCH 3/3] btrfs: increase ctx->pos for delayed dir index josef
2017-07-24 12:42 ` [PATCH 1/3] btrfs: don't allow trans ioctl on a directory David Sterba
2017-07-24 12:58   ` David Sterba
2017-07-24 14:02   ` Josef Bacik
2017-07-24 16:02     ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).