From linux-kernel@vger.kernel.org Tue Jan 6 22:56:54 2004 Date: Mon, 05 Jan 2004 21:40:37 +0000 From: Linux Kernel Mailing List To: bk-commits-24@vger.kernel.org Subject: [PATCH] fix broken 2.4.x rt_sigprocmask error handling ChangeSet 1.1377, 2004/01/05 19:40:37-02:00, andersen@codepoet.org [PATCH] fix broken 2.4.x rt_sigprocmask error handling SuSv3 says: "The argument 'how' indicates the way in which the set is changed, and the application shall ensure it consists of one of [SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK] ... If sigprocmask() fails, the thread's signal mask shall not be changed." The sigprocmask(2) syscall implements this correctly, however the rt_sigprocmask(2) syscall in 2.4.x does not comply with SuSv3. When this syscall is provided with a valid 'set' value, and a bogus value for 'how', the process signal mask is still changed. The attached test application demonstrates the problem. This patch below fixes it. Please apply! # This patch includes the following deltas: # ChangeSet 1.1376 -> 1.1377 # kernel/signal.c 1.9 -> 1.10 # CREDITS 1.90 -> 1.91 # CREDITS | 10 +++++----- kernel/signal.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff -Nru a/CREDITS b/CREDITS --- a/CREDITS Tue Jan 6 04:01:47 2004 +++ b/CREDITS Tue Jan 6 04:01:47 2004 @@ -83,13 +83,13 @@ S: USA N: Erik Andersen -E: andersee@debian.org -W: http://www.xmission.com/~andersen -P: 1024/FC4CFFED 78 3C 6A 19 FA 5D 92 5A FB AC 7B A5 A5 E1 FF 8E +E: andersen@codepoet.org +W: http://www.codepoet.org/ +P: 1024D/30D39057 1BC4 2742 E885 E4DE 9301 0C82 5F9B 643E 30D3 9057 D: Maintainer of ide-cd and Uniform CD-ROM driver, D: ATAPI CD-Changer support, Major 2.1.x CD-ROM update. -S: 4538 South Carnegie Tech Street -S: Salt Lake City, Utah 84120 +S: 352 North 525 East +S: Springville, Utah 84663 S: USA N: Michael Ang diff -Nru a/kernel/signal.c b/kernel/signal.c --- a/kernel/signal.c Tue Jan 6 04:01:47 2004 +++ b/kernel/signal.c Tue Jan 6 04:01:47 2004 @@ -879,16 +879,16 @@ error = -EINVAL; break; case SIG_BLOCK: - sigorsets(&new_set, &old_set, &new_set); + sigorsets(¤t->blocked, &old_set, &new_set); break; case SIG_UNBLOCK: - signandsets(&new_set, &old_set, &new_set); + signandsets(¤t->blocked, &old_set, &new_set); break; case SIG_SETMASK: + current->blocked = new_set; break; } - current->blocked = new_set; recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); if (error) - To unsubscribe from this list: send the line "unsubscribe bk-commits-24" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html