Skip to contentSkip to conversation

epoll: don't printk pointer value

PATCH In review Robert Love 4 participants 7 messages Dec 11, 2002 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 epoll: don't printk pointer value

Davide,

I really cannot think of a good reason why eventpoll_init() should print a pointer value to user-space - especially the value of current?

I do not think this is good practice and someone might even consider it a security hole. Personally, I would prefer to remove the "successfully initialized" message altogether, but at the very least can we not print current's address?

Robert Love

 fs/eventpoll.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
fs/eventpoll.c +1 -1
diff -urN linux-2.5.51/fs/eventpoll.c linux/fs/eventpoll.c
@@ -1573,7 +1573,7 @@
 	if (IS_ERR(eventpoll_mnt))
 		goto eexit_4;
 
-	printk(KERN_INFO "[%p] eventpoll: successfully initialized.\n", current);
+	printk(KERN_INFO "eventpoll: successfully initialized.\n", current);
 
 	return 0;
 
#1 lore raw
Quoted 6 lines · Robert Love

I really cannot think of a good reason why eventpoll_init() should print a pointer value to user-space - especially the value of current? I do not think this is good practice and someone might even consider it a security hole. Personally, I would prefer to remove the "successfully initialized" message altogether, but at the very least can we not print current's address?

You're still passing current as an argument to the printk.

Bill

#2 lore raw
Quoted 1 line · William Lee Irwin III

You're still passing current as an argument to the printk.

Ah crap. That is what I get for not testing it... nothing is too trivial, boys and girls.

Thanks, Bill.

Robert Love

 fs/eventpoll.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
fs/eventpoll.c +1 -1
diff -urN linux-2.5.51/fs/eventpoll.c linux/fs/eventpoll.c
@@ -1573,7 +1573,7 @@
 	if (IS_ERR(eventpoll_mnt))
 		goto eexit_4;
 
-	printk(KERN_INFO "[%p] eventpoll: successfully initialized.\n", current);
+	printk(KERN_INFO "eventpoll: successfully initialized.\n");
 
 	return 0;
 
#3 lore raw

fs/eventpoll.c 2002-12-11 01:23:07.000000000 -0500 line 1577

Quoted 11 lines · Robert Love

...

fs/eventpoll.c 2002-12-11 01:23:07.000000000 -0500 renamed from fs/eventpoll.c 2002-12-09 21:45:54.000000000 -0500 +1 -1
@@ -1573,7 +1573,7 @@
        if (IS_ERR(eventpoll_mnt))
                goto eexit_4;
 
-       printk(KERN_INFO "[%p] eventpoll: successfully initialized.\n", current);
+       printk(KERN_INFO "eventpoll: successfully initialized.\n");
 

Guys, it's noise. Just nuke it.

#4 lore raw
Quoted 1 line · Andrew Morton

Guys, it's noise. Just nuke it.

So I would prefer...

Robert Love

 fs/eventpoll.c |    2 --
 1 files changed, 2 deletions(-)
fs/eventpoll.c +0 -2
diff -urN linux-2.5.51/fs/eventpoll.c linux/fs/eventpoll.c
@@ -1573,8 +1573,6 @@
 	if (IS_ERR(eventpoll_mnt))
 		goto eexit_4;
 
-	printk(KERN_INFO "[%p] eventpoll: successfully initialized.\n", current);
-
 	return 0;
 
 eexit_4:
#6 lore raw
In reply to Robert Love
Quoted 9 lines · Robert Love

Davide,

I really cannot think of a good reason why eventpoll_init() should print a pointer value to user-space - especially the value of current?

I do not think this is good practice and someone might even consider it a security hole. Personally, I would prefer to remove the "successfully initialized" message altogether, but at the very least can we not print current's address?

It's ok Robert, it was used for debugging purposes and now it can be completely removed ( the whole printk() ). I'll post a patch to Linus that removes the printk() ...

- Davide