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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 19 Oct 2014 02:10:08 +0200
From:	Martin Kepplinger <>
	"" <>
Subject: lguest: lguest_user.c is open() called by the user?


Just a question for understanding: open() is not implemented in
lguest_user.c's miscdevice. The miscdevice core, in this case, does
_not_ set file->private_data on a user's open() call. Is open() called
by the user here? and do you here _depend_ on file->private_data being
NULL after open()? (could you even?)

Would the following force to NULL be necessary if the miscdevice core
_would_ set private_data?

diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index 4263f4c..3d472ea 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -497,6 +497,12 @@ static int close(struct inode *inode, struct file
        return 0;

+static int open(struct inode *inode, struct file *file)
+       /* assuming the miscdevice core sets private_data on open() */
+       file->private_data = NULL;
  * Welcome to our journey through the Launcher!
@@ -514,6 +520,7 @@ static int close(struct inode *inode, struct file *file)
 static const struct file_operations lguest_fops = {
        .owner   = THIS_MODULE,
+       .open    = open,
        .release = close,
        .write   = write,
        .read    = read,

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists