From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH 6/7] fcntl: Don't use ambiguous SIG_POLL si_codes Date: Thu, 20 Jul 2017 18:16:04 +0200 Message-ID: <20170720161603.GA14430@redhat.com> References: <87o9shg7t7.fsf_-_@xmission.com> <20170718140651.15973-6-ebiederm@xmission.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20170718140651.15973-6-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: "Eric W. Biederman" Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andrei Vagin , Greg KH , Linux Containers , Pavel Emelyanov , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Al Viro , Andy Lutomirski , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Cyrill Gorcunov , Michael Kerrisk , Thomas Gleixner , Linus Torvalds , Willy Tarreau , Andrey Vagin List-Id: linux-arch.vger.kernel.org On 07/18, Eric W. Biederman wrote: > > - BUG_ON((reason & __SI_MASK) != __SI_POLL); > + BUG_ON((reason < POLL_IN) || (reason > NSIGPOLL)); ^^^^^^^^^^^^^^^^^ looks obviously wrong? Say, POLL_IN is obviously > NSIGPOLL == 6. Probably you meant BUG_ON((reason < POLL_IN) || (reason - POLL_IN > NSIGPOLL) ? but this contradicts with the next line: > if (reason - POLL_IN >= NSIGPOLL) > si.si_band = ~0L; confused... Oleg. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:55630 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965130AbdGTQQI (ORCPT ); Thu, 20 Jul 2017 12:16:08 -0400 Date: Thu, 20 Jul 2017 18:16:04 +0200 From: Oleg Nesterov Subject: Re: [PATCH 6/7] fcntl: Don't use ambiguous SIG_POLL si_codes Message-ID: <20170720161603.GA14430@redhat.com> References: <87o9shg7t7.fsf_-_@xmission.com> <20170718140651.15973-6-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170718140651.15973-6-ebiederm@xmission.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Linus Torvalds , Al Viro , Andrei Vagin , Thomas Gleixner , Greg KH , Andrey Vagin , Serge Hallyn , Pavel Emelyanov , Cyrill Gorcunov , Peter Zijlstra , Willy Tarreau , linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Linux Containers , Michael Kerrisk Message-ID: <20170720161604.PiWz-tlx8ZVfRK7k3gCbR2HNRCVK_K_-oXBWYidSkWQ@z> On 07/18, Eric W. Biederman wrote: > > - BUG_ON((reason & __SI_MASK) != __SI_POLL); > + BUG_ON((reason < POLL_IN) || (reason > NSIGPOLL)); ^^^^^^^^^^^^^^^^^ looks obviously wrong? Say, POLL_IN is obviously > NSIGPOLL == 6. Probably you meant BUG_ON((reason < POLL_IN) || (reason - POLL_IN > NSIGPOLL) ? but this contradicts with the next line: > if (reason - POLL_IN >= NSIGPOLL) > si.si_band = ~0L; confused... Oleg.