From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Chris Wright <chrisw@osdl.org>
Cc: Roland McGrath <roland@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] Always send siginfo for synchronous signals
Date: Wed, 23 Feb 2005 15:09:51 -0800 [thread overview]
Message-ID: <421D0D3F.40902@goop.org> (raw)
In-Reply-To: <20050223201903.GF21662@shell0.pdx.osdl.net>
Chris Wright wrote:
>It's not quite inexplicable. It means that task has hit its limit for
>pending signals ;-) But I agree, this should be fixed. I think I had
>tested this with broken test cases, thanks for catching.
>
>
It's particularly confusing for users, because it's a per-user limit
rather than a per-process one, and its not at all apparent which program
is causing the problem (/proc/N/status will tell you that a process has
a signal pending, but it won't tell you how many are pending).
In fact, bugs with these symptoms have been reported against Valgrind
from time to time for years, and its only recently I worked out what's
going on (mostly because I introduced a bug which caused Valgrind to do
it to itself).
>>+static struct sigqueue *__sigqueue_alloc(struct task_struct *t, int flags, int always)
>>
>>
>maybe force_info instead of always?
>
>
I suppose, but it doesn't "force" it really. The allocation could still
fail (it is GFP_ATOMIC after all), and you'd still get no siginfo. I
don't care much either way.
>> /*
>> * fast-pathed signals for kernel-internal things like SIGSTOP
>>@@ -785,6 +793,13 @@ static int send_signal(int sig, struct s
>> if ((unsigned long)info == 2)
>> goto out_set;
>>
>>+ /* Always attempt to send siginfo with an unblocked
>>+ fault-generated signal. */
>>+ always = sig_kernel_sync(sig) &&
>>+ !sigismember(&t->blocked, sig) &&
>>
>>
>Aren't these already unblocked?
>
>
I can't think of a case where they wouldn't be, but I wanted to make
sure this couldn't be used to create a new DoS.
>>+ (unsigned long)info > 2 &&
>>+ info->si_code > SI_USER;
>>
>>
>In what case is != SI_KERNEL OK?
>
>
Fault signals rarely have an si_code of SI_KERNEL (0x80); they generally
have a small integer to describe what the fault was really about
(SEGV_MAPERR, etc). All si_codes > SI_USER (0) are defined to have come
from the kernel. Hm, I see there's a macro, SI_FROMKERNEL, for doing
this test.
Updated patch attached.
J
next prev parent reply other threads:[~2005-02-23 23:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-23 6:42 [PATCH] Always send siginfo for synchronous signals Jeremy Fitzhardinge
2005-02-23 20:19 ` Chris Wright
2005-02-23 23:09 ` Jeremy Fitzhardinge [this message]
2005-02-23 23:46 ` Chris Wright
2005-02-24 0:50 ` Jeremy Fitzhardinge
2005-02-24 2:07 ` [PATCH] show RLIMIT_SIGPENDING usage in /proc/PID/status Roland McGrath
2005-02-24 2:33 ` Chris Wright
2005-02-24 2:55 ` Roland McGrath
2005-02-24 3:06 ` Chris Wright
2005-02-24 2:24 ` [PATCH] set RLIMIT_SIGPENDING limit based on RLIMIT_NPROC Roland McGrath
2005-02-24 3:07 ` Chris Wright
2005-02-25 2:05 ` Jeremy Fitzhardinge
2005-02-25 2:10 ` Chris Wright
2005-02-23 23:44 ` [PATCH] Always send siginfo for synchronous signals Jeremy Fitzhardinge
2005-02-24 1:45 ` [PATCH] override RLIMIT_SIGPENDING for non-RT signals Roland McGrath
2005-02-24 2:32 ` Chris Wright
2005-02-24 2:43 ` Roland McGrath
2005-02-24 3:12 ` Chris Wright
2005-02-25 2:01 ` Jeremy Fitzhardinge
2005-02-25 2:12 ` Chris Wright
2005-02-25 2:16 ` Roland McGrath
2005-02-25 3:02 ` Chris Wright
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=421D0D3F.40902@goop.org \
--to=jeremy@goop.org \
--cc=akpm@osdl.org \
--cc=chrisw@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@redhat.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