lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427115589-469-4-git-send-email-martink@posteo.de>
Date:	Mon, 23 Mar 2015 13:59:48 +0100
From:	Martin Kepplinger <martink@...teo.de>
To:	tomvanbraeckel@...il.com
Cc:	linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
	arnd@...db.de, Martin Kepplinger <martink@...teo.de>
Subject: [PATCH 3/4] fs: btrfs: set file->private data NULL after open() because we depend on it

We depend on private_data being NULL to record transaction ioctl start and end.
This allows the misc core's misc_open() to do whatever it wants.

Signed-off-by: Martin Kepplinger <martink@...teo.de>
---
 fs/btrfs/super.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 05fef19..00dd2a6 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1993,6 +1993,16 @@ static int btrfs_show_devname(struct seq_file *m, struct dentry *root)
 	return 0;
 }
 
+static int btrfs_control_open(struct inode *inode, struct file *file)
+{
+	/*
+	 * we use private_data in the transaction start ioctl to record
+	 * it being started.
+	 */
+	file->private_data = NULL;
+	return 0;
+}
+
 static const struct super_operations btrfs_super_ops = {
 	.drop_inode	= btrfs_drop_inode,
 	.evict_inode	= btrfs_evict_inode,
@@ -2013,6 +2023,7 @@ static const struct file_operations btrfs_ctl_fops = {
 	.compat_ioctl = btrfs_control_ioctl,
 	.owner	 = THIS_MODULE,
 	.llseek = noop_llseek,
+	.open = btrfs_control_open,
 };
 
 static struct miscdevice btrfs_misc = {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ