]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fanotify: info leak in copy_event_to_user()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 19 Jun 2013 00:05:29 +0000 (10:05 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:12:43 +0000 (17:12 +1000)
The ->reserverd field isn't cleared so we leak one byte of stack
information to userspace.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Eric Paris <eparis@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/notify/fanotify/fanotify_user.c

index 6c80083a984fc192ebc73bad2a2edc86b4c25e11..77cc85dd0db01f1ead504e96e8f521d11eeb8af4 100644 (file)
@@ -122,6 +122,7 @@ static int fill_event_metadata(struct fsnotify_group *group,
        metadata->event_len = FAN_EVENT_METADATA_LEN;
        metadata->metadata_len = FAN_EVENT_METADATA_LEN;
        metadata->vers = FANOTIFY_METADATA_VERSION;
+       metadata->reserved = 0;
        metadata->mask = event->mask & FAN_ALL_OUTGOING_EVENTS;
        metadata->pid = pid_vnr(event->tgid);
        if (unlikely(event->mask & FAN_Q_OVERFLOW))