linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [BUG] fs: inotify_handle_event() reading un-init memory
@ 2015-06-16 11:33 Jesper Dangaard Brouer
  2015-06-16 13:52 ` Jan Kara
  0 siblings, 1 reply; 6+ messages in thread
From: Jesper Dangaard Brouer @ 2015-06-16 11:33 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-mm, linux-kernel, Jesper Dangaard Brouer

Caught by kmemcheck.

Don't know the fix... just pointed at the bug.

Introduced in commit 7053aee26a3 ("fsnotify: do not share
events between notification groups").
---
 fs/notify/inotify/inotify_fsnotify.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c
index 2cd900c2c737..370d66dc4ddb 100644
--- a/fs/notify/inotify/inotify_fsnotify.c
+++ b/fs/notify/inotify/inotify_fsnotify.c
@@ -96,11 +96,12 @@ int inotify_handle_event(struct fsnotify_group *group,
 	i_mark = container_of(inode_mark, struct inotify_inode_mark,
 			      fsn_mark);
 
+	// new object alloc here
 	event = kmalloc(alloc_len, GFP_KERNEL);
 	if (unlikely(!event))
 		return -ENOMEM;
 
-	fsn_event = &event->fse;
+	fsn_event = &event->fse; // This looks wrong!?! read from un-init mem?
 	fsnotify_init_event(fsn_event, inode, mask);
 	event->wd = i_mark->wd;
 	event->sync_cookie = cookie;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-06-17 10:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-16 11:33 [BUG] fs: inotify_handle_event() reading un-init memory Jesper Dangaard Brouer
2015-06-16 13:52 ` Jan Kara
2015-06-16 20:22   ` Jesper Dangaard Brouer
2015-06-17  8:13     ` Jan Kara
2015-06-17  9:57       ` Jesper Dangaard Brouer
2015-06-17 10:17         ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).