From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, brouer@redhat.com
Subject: Re: [BUG] fs: inotify_handle_event() reading un-init memory
Date: Tue, 16 Jun 2015 22:22:34 +0200 [thread overview]
Message-ID: <20150616222234.3ebc6402@redhat.com> (raw)
In-Reply-To: <20150616135209.GD7038@quack.suse.cz>
On Tue, 16 Jun 2015 15:52:09 +0200 Jan Kara <jack@suse.cz> wrote:
> On Tue 16-06-15 13:33:18, Jesper Dangaard Brouer wrote:
> > 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?
>
> Where is here any read? This is just a pointer arithmetics where we add
> offset of 'fse' entry to 'event' address.
I was kmemcheck that complained, perhaps it is a false-positive?
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, brouer@redhat.com
Subject: Re: [BUG] fs: inotify_handle_event() reading un-init memory
Date: Tue, 16 Jun 2015 22:22:34 +0200 [thread overview]
Message-ID: <20150616222234.3ebc6402@redhat.com> (raw)
In-Reply-To: <20150616135209.GD7038@quack.suse.cz>
On Tue, 16 Jun 2015 15:52:09 +0200 Jan Kara <jack@suse.cz> wrote:
> On Tue 16-06-15 13:33:18, Jesper Dangaard Brouer wrote:
> > 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?
>
> Where is here any read? This is just a pointer arithmetics where we add
> offset of 'fse' entry to 'event' address.
I was kmemcheck that complained, perhaps it is a false-positive?
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
next prev parent reply other threads:[~2015-06-16 20:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-16 11:33 [BUG] fs: inotify_handle_event() reading un-init memory Jesper Dangaard Brouer
2015-06-16 11:33 ` Jesper Dangaard Brouer
2015-06-16 13:52 ` Jan Kara
2015-06-16 13:52 ` Jan Kara
2015-06-16 20:22 ` Jesper Dangaard Brouer [this message]
2015-06-16 20:22 ` Jesper Dangaard Brouer
2015-06-17 8:13 ` Jan Kara
2015-06-17 8:13 ` Jan Kara
2015-06-17 9:57 ` Jesper Dangaard Brouer
2015-06-17 9:57 ` Jesper Dangaard Brouer
2015-06-17 10:17 ` Jan Kara
2015-06-17 10:17 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150616222234.3ebc6402@redhat.com \
--to=brouer@redhat.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.