From: Oleg Nesterov <oleg@tv-sign.ru>
To: S?bastien Dugu? <sebastien.dugue@bull.net>
Cc: Zach Brown <zach.brown@oracle.com>,
Suparna Bhattacharya <suparna@in.ibm.com>,
Benjamin LaHaise <bcrl@kvack.org>,
Ulrich Drepper <drepper@redhat.com>, Ingo Molnar <mingo@elte.hu>,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: + make-good_sigevent-non-static.patch added to -mm tree
Date: Fri, 26 Jan 2007 13:08:01 +0300 [thread overview]
Message-ID: <20070126100801.GA94@tv-sign.ru> (raw)
In-Reply-To: <20070126103208.78c4937f@frecb000686>
On 01/26, S?bastien Dugu? wrote:
>
> On Thu, 25 Jan 2007 18:43:24 +0300 Oleg Nesterov <oleg@tv-sign.ru> wrote:
>
> > SИbastien DuguИ wrote:
> > >
> > > +struct task_struct *good_sigevent(sigevent_t *event)
> > > +{
> > > + struct task_struct *task = current->group_leader;
> > > +
> > > + if ((event->sigev_notify & SIGEV_THREAD_ID) == SIGEV_THREAD_ID) {
> > > + task = find_task_by_pid(event->sigev_notify_thread_id);
> > > +
> > > + if (!task || task->tgid != current->tgid)
> > > + return NULL;
> > > + } else if (event->sigev_notify == SIGEV_SIGNAL) {
> >
> > No, no, we can't use "else" here,
> >
> > > + if (event->sigev_signo <= 0 || event->sigev_signo > SIGRTMAX)
> >
> > because we skip the check above in SIGEV_THREAD_ID case.
>
> Right, will fix this.
>
> >
> > This way any user can crash the kernel with a minimal effort.
>
> Well I tried, no crash, just the signal failing to be delivered.
sigaddset:
set->sig[sig / _NSIG_BPW] |= 1UL << (sig % _NSIG_BPW);
This writes to ->sig[event->sigev_signo / _NSIG_BPW] location, so we can
corrupt the memory if ->sigev_signo > _NSIG.
Btw, since you are exporting this function, may I suggest to rename it?
No, I can't suggest a better name :) But "good_sigevent" is a bit confusing
imho.
Oleg.
next prev parent reply other threads:[~2007-01-26 10:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-25 15:43 + make-good_sigevent-non-static.patch added to -mm tree Oleg Nesterov
2007-01-26 9:32 ` Sébastien Dugué
2007-01-26 10:08 ` Oleg Nesterov [this message]
2007-01-26 10:39 ` Sébastien Dugué
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=20070126100801.GA94@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@osdl.org \
--cc=bcrl@kvack.org \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=sebastien.dugue@bull.net \
--cc=suparna@in.ibm.com \
--cc=tglx@linutronix.de \
--cc=zach.brown@oracle.com \
/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