lkml.org 
[lkml]   [2004]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [RFC][PATCH] inotify 0.13
From
Date
Everything sent to user-space needs to be zeroed out first, to prevent
leaking random kernel memory. So, we need to zero out the
inotify_kernel_event structure after allocating it.

We need to do this even though we initialize the fields in case of
structure padding. Also, the filename field.

Patch is attached, on top of 0.13.1.

Robert Love

Signed-Off-By: Robert Love <rml@novell.com>

drivers/char/inotify.c | 3 +++
1 files changed, 3 insertions(+)

diff -urN linux-inotify-0.13/drivers/char/inotify.c linux/drivers/char/inotify.c
--- linux-inotify-0.13/drivers/char/inotify.c 2004-10-06 16:47:54.000000000 -0400
+++ linux/drivers/char/inotify.c 2004-10-06 18:20:55.604363400 -0400
@@ -140,6 +140,9 @@
goto out;
}

+ /* we hand this out to user-space, so zero it out just in case */
+ memset(kevent, 0, sizeof(struct inotify_kernel_event));
+
iprintk(INOTIFY_DEBUG_ALLOC, "alloced kevent %p (%d,%d)\n",
kevent, wd, mask);
\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.071 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site