Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934484AbaKMWJk (ORCPT ); Thu, 13 Nov 2014 17:09:40 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:40755 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934044AbaKMWJi (ORCPT ); Thu, 13 Nov 2014 17:09:38 -0500 Date: Thu, 13 Nov 2014 14:09:36 -0800 From: Andrew Morton To: Maxime COQUELIN Cc: linux@rasmusvillemoes.dk, gong.chen@linux.intel.com, Peter Zijlstra , Ingo Molnar , " Paul E. McKenney" , tytso@mit.edu, linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel@stlinux.com, eric.paire@st.com Subject: Re: [PATCH v4] bitops: Fix shift overflow in GENMASK macros Message-Id: <20141113140936.e2e45a8970b5bb4195fd5065@linux-foundation.org> In-Reply-To: <1415267659-10563-1-git-send-email-maxime.coquelin@st.com> References: <1415267659-10563-1-git-send-email-maxime.coquelin@st.com> X-Mailer: Sylpheed 3.4.0beta7 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Nov 2014 10:54:19 +0100 Maxime COQUELIN wrote: > On some 32 bits architectures, including x86, GENMASK(31, 0) returns 0 > instead of the expected ~0UL. > > This is the same on some 64 bits architectures with GENMASK_ULL(63, 0). > > This is due to an overflow in the shift operand, 1 << 32 for GENMASK, > 1 << 64 for GENMASK_ULL. > > Fixes: 10ef6b0dffe404bcc54e94cb2ca1a5b18445a66b > Cc: #v3.13+ > Reported-by: Eric Paire > Suggested-by: Rasmus Villemoes > Signed-off-by: Maxime Coquelin Why cc:stable? Does this bug cause some observed kernel misbehaviour? If so, please fully describe that in the changelog. This will help people to determine whether this patch might fix a bug they're observing, and will help them to decide whether they should backport this patch into their kernels. I'm assuming that Peter will be merging this patch. -- 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/