linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jann Horn <jannhorn-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
To: Pavel Emelyanov <xemul-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
	Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Michael Kerrisk
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 3/3] posix timers: Add syscall that works on timer sigevent
Date: Sun, 17 Feb 2013 14:42:48 +0100	[thread overview]
Message-ID: <20130217134248.GD13378@debjann.fritz.box> (raw)
In-Reply-To: <511D0EA1.9060704-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 601 bytes --]

On Thu, Feb 14, 2013 at 08:19:45PM +0400, Pavel Emelyanov wrote:
> +	struct sigevent event;
[...]
> +	event.sigev_notify = timer->it_sigev_notify;
> +	event.sigev_signo = timer->sigq->info.si_signo;
> +	event.sigev_value = timer->sigq->info.si_value;
> +	event.sigev_notify_thread_id = pid_vnr(timer->it_pid);
[...]
> +	if (old_event && copy_to_user(old_event, &event, sizeof(event)))

Won't this leak uninitialized kernel stack data to userspace? As far as I can
see, the _sigev_un union is bigger than the _tid field in it, so the rest of
it will be copied over without initialization, right?

Jann

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-02-17 13:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 16:18 [PATCH 0/3] posix timers: Extend kernel API to report more info about timers Pavel Emelyanov
2013-02-14 16:19 ` [PATCH 1/3] posix timers: Allocate timer id per process Pavel Emelyanov
     [not found]   ` <511D0E77.2090907-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2013-02-14 20:13     ` Sasha Levin
     [not found]       ` <CA+1xoqdk5PArnjSnu=7gUq_4got09a0PxBd4Yy=inezPTGsdAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-15  5:13         ` Pavel Emelyanov
     [not found] ` <511D0E50.7090505-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2013-02-14 16:19   ` [PATCH 2/3] posix timers: Add syscall that lists timer IDs armed by process Pavel Emelyanov
2013-02-14 16:19   ` [PATCH 3/3] posix timers: Add syscall that works on timer sigevent Pavel Emelyanov
     [not found]     ` <511D0EA1.9060704-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2013-02-17 13:42       ` Jann Horn [this message]
     [not found]         ` <20130217134248.GD13378-7cfQGs147y6a6lf8Wg2v7Z5kstrrjoWp@public.gmane.org>
2013-02-17 18:53           ` Pavel Emelyanov
2013-02-21  1:21   ` [PATCH 0/3] posix timers: Extend kernel API to report more info about timers Matthew Helsley
     [not found]     ` <CA+RrjuURQTCP8yMa4nWxNQg=qxxsu6vrko2UVK4f8pFYbK6SYQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-21 10:35       ` Pavel Emelyanov

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=20130217134248.GD13378@debjann.fritz.box \
    --to=jannhorn-gm/ye1e23mwn+bqq9rbeug@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    --cc=xemul-bzQdu9zFT3WakBO8gow8eQ@public.gmane.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 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).