Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758444Ab2BNRa3 (ORCPT ); Tue, 14 Feb 2012 12:30:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38333 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754002Ab2BNRa1 (ORCPT ); Tue, 14 Feb 2012 12:30:27 -0500 Date: Tue, 14 Feb 2012 18:23:40 +0100 From: Oleg Nesterov To: David Howells Cc: Matt Fleming , linux-arch@vger.kernel.org, Andrew Morton , linux-kernel@vger.kernel.org, Matt Fleming , Koichi Yasutake , Al Viro , linux-am33-list@redhat.com Subject: Re: [PATCH 20/40] mn10300: Use set_current_blocked() and block_sigmask() Message-ID: <20120214172340.GA22645@redhat.com> References: <1329219673-28711-21-git-send-email-matt@console-pimps.org> <1329219673-28711-1-git-send-email-matt@console-pimps.org> <17603.1329234976@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17603.1329234976@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 960 Lines: 27 On 02/14, David Howells wrote: > > Matt Fleming wrote: > > > asmlinkage long sys_sigsuspend(int history0, int history1, old_sigset_t mask) > > { > > - mask &= _BLOCKABLE; > > - spin_lock_irq(¤t->sighand->siglock); > > + sigset_t blocked; > > + > > current->saved_sigmask = current->blocked; > > Can this line create a race, now that it's not protected by a lock? It is > possible for current->blocked to get altered by another thread. No, only current can change ->blocked. This is even documented in sigprocmask(). And more, the only correct way to change ->blocked is set_current_blocked(). OK, with a couple of "I know what I am doing" exceptions in kernel/signal.c. Oleg. -- 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/