From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753502AbcERRF4 (ORCPT ); Wed, 18 May 2016 13:05:56 -0400 Received: from smtp1.it.da.ut.ee ([193.40.5.66]:54848 "EHLO smtp1.it.da.ut.ee" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187AbcERRFz (ORCPT ); Wed, 18 May 2016 13:05:55 -0400 Date: Wed, 18 May 2016 21:30:57 +0300 (EEST) From: Meelis Roos To: Oleg Nesterov cc: Andrew Morton , Linux Kernel list Subject: Re: [PATCH] signal: move the "sig < SIGRTMIN" check into siginmask(sig) In-Reply-To: <20160517195052.GA15187@redhat.com> Message-ID: References: <20160517195052.GA15187@redhat.com> User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > All the users of siginmask() must ensure that sig < SIGRTMIN. sig_fatal() > doesn't and this is wrong: > > [ 211.406327] UBSAN: Undefined behaviour in kernel/signal.c:911:6 > [ 211.406365] shift exponent 32 is too large for 32-bit type 'long unsigned int' > > the patch doesn't add the neccesary check to sig_fatal(), it moves the > check into siginmask() and updates other callers. > > Reported-by: Meelis Roos > Signed-off-by: Oleg Nesterov Tested on the same AthlonMP, on HP Proliant DL360G3 and PowerMac G4, successfully - system still works, warnings are gone. -- Meelis Roos (mroos@linux.ee)