From: Erik Andersen <andersen@codepoet.org>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fix broken 2.4.x rt_sigprocmask error handling
Date: Mon, 5 Jan 2004 06:56:33 -0700 [thread overview]
Message-ID: <20040105135632.GA26836@codepoet.org> (raw)
In-Reply-To: <Pine.LNX.4.58L.0401051112390.1188@logos.cnet>
On Mon Jan 05, 2004 at 11:23:02AM -0200, Marcelo Tosatti wrote:
> Hi Erik,
>
> For how long the behaviour has been this? It is broken, but its brokenness
> is harmless.
Not sure really. It is correct in 2.2.x, and 2.6.x, but is
wrong in all 2.4.x kernels starting with 2.4.0, but I havn't
bothered finding exactly which kernel broke things.
> Maybe some app rely on this behaviour? (I understand its wrong, but
> still).
>
> Is there any major distribution which includes this fix?
I highly doubt anything relies on this. Glibc checks for this
case before the syscall is made. I found the bug while running
some the ltp testsuite on uClibc. I have since added a check to
workaround the bug. but I would prefer to have it fixed properly
in the kernel.
> Anyway, isnt it easier to move the "if (error)" up like this?
>
> --- signal.c.orig 2004-01-05 11:13:17.000000000 -0200
> +++ signal.c 2004-01-05 11:14:09.000000000 -0200
> @@ -888,11 +888,12 @@
> break;
> }
>
> + if (error)
> + goto out;
> +
> current->blocked = new_set;
> recalc_sigpending(current);
> spin_unlock_irq(¤t->sigmask_lock);
> - if (error)
> - goto out;
> if (oset)
> goto set_old;
> } else if (oset) {
Only if you plan to ignore the locked spinlock. :-)
The 2.2.x code does this:
-current->blocked = new_set;
+if (!error)
current->blocked = new_set;
I condiered that, but I thought it better to make the code
more closely match 2.6, which looked a bit nicer.
-Erik
--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
prev parent reply other threads:[~2004-01-05 13:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-31 11:45 Erik Andersen
2004-01-05 13:23 ` Marcelo Tosatti
2004-01-05 13:56 ` Erik Andersen [this message]
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=20040105135632.GA26836@codepoet.org \
--to=andersen@codepoet.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.tosatti@cyclades.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
Powered by JetHome