Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761379Ab2EJAAk (ORCPT ); Wed, 9 May 2012 20:00:40 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:50328 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760488Ab2EJAAi (ORCPT ); Wed, 9 May 2012 20:00:38 -0400 MIME-Version: 1.0 In-Reply-To: <4FAAEB37.1080001@siemens.com> References: <4FAAEB37.1080001@siemens.com> From: Linus Torvalds Date: Wed, 9 May 2012 17:00:16 -0700 X-Google-Sender-Auth: AheXYFhQ78X0ZUTMjnaMssQNmEc Message-ID: Subject: Re: [PATCH] compat: Fix RT signal mask corruption via sigprocmask To: Jan Kiszka Cc: Linux Kernel Mailing List , linux-arch@vger.kernel.org, Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , Michael Tokarev , Anthony Liguori , Kevin Wolf Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1036 Lines: 24 On Wed, May 9, 2012 at 3:09 PM, Jan Kiszka wrote: > compat_sys_sigprocmask reads a smaller signal mask from userspace than > sigprogmask accepts for setting. So the high word of blocked.sig[0] will > be cleared, releasing any potentially blocked RT signal. I see what you're trying to do, but I think your patch is wrong. It may work for SIG_BLOCK and SIG_SETMASK to use the current blocked bits in the high bits, but I'm pretty sure it doesn't work at all for SIG_UNBLOCK. I suspect that compat_sys_sigprocmask() should simply be rewritten to *not* use sys_sigprocmask() at all, but simply open-code the three cases directly. IOW, copy the code from sys_sigprocmask(), and modify it for an incoming/outgoing compat_old_sigset_t. Hmm? Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/