[commits] batman-adv; branch, next, updated. v2010.1.0-31-gb7921b5

postmaster at open-mesh.org postmaster at open-mesh.org
Sat Sep 18 13:26:07 CEST 2010


The following commit has been merged in the next branch:
commit b7921b53fad82319e90469d90844248a93a09d89
Author: Sven Eckelmann <sven.eckelmann at gmx.de>
Date:   Sat Sep 18 11:14:17 2010 +0000

    batman-adv: Mark debugfs files as nonseekable
    
    We don't allow to seek in the debugfs socket and log files. Thus we
    should mark the file descriptor as nonseekable.
    
    Signed-off-by: Sven Eckelmann <sven.eckelmann at gmx.de>
    Acked-by: Arnd Bergmann <arnd at arndb.de>

diff --git a/bat_debugfs.c b/bat_debugfs.c
index f40ef35..20aefca 100644
--- a/bat_debugfs.c
+++ b/bat_debugfs.c
@@ -91,6 +91,7 @@ int debug_log(struct bat_priv *bat_priv, char *fmt, ...)
 
 static int log_open(struct inode *inode, struct file *file)
 {
+	nonseekable_open(inode, file);
 	file->private_data = inode->i_private;
 	inc_module_count();
 	return 0;
@@ -175,6 +176,7 @@ static const struct file_operations log_fops = {
 	.release        = log_release,
 	.read           = log_read,
 	.poll           = log_poll,
+	.llseek         = no_llseek,
 };
 
 static int debug_log_setup(struct bat_priv *bat_priv)
diff --git a/icmp_socket.c b/icmp_socket.c
index 85c047b..aa64ff8 100644
--- a/icmp_socket.c
+++ b/icmp_socket.c
@@ -47,6 +47,8 @@ static int bat_socket_open(struct inode *inode, struct file *file)
 	unsigned int i;
 	struct socket_client *socket_client;
 
+	nonseekable_open(inode, file);
+
 	socket_client = kmalloc(sizeof(struct socket_client), GFP_KERNEL);
 
 	if (!socket_client)
@@ -285,6 +287,7 @@ static const struct file_operations fops = {
 	.read = bat_socket_read,
 	.write = bat_socket_write,
 	.poll = bat_socket_poll,
+	.llseek = no_llseek,
 };
 
 int bat_socket_setup(struct bat_priv *bat_priv)

-- 
batman-adv


More information about the commits mailing list