From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:53259 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934774AbcIVPpD (ORCPT ); Thu, 22 Sep 2016 11:45:03 -0400 Subject: Patch "sh: cmpxchg: fix a bit shift bug in big_endian os" has been added to the 4.7-stable tree To: xinhui.pan@linux.vnet.ibm.com, dalias@libc.org, gregkh@linuxfoundation.org, mst@redhat.com Cc: , From: Date: Thu, 22 Sep 2016 17:43:31 +0200 Message-ID: <1474559011205123@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled sh: cmpxchg: fix a bit shift bug in big_endian os to the 4.7-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: sh-cmpxchg-fix-a-bit-shift-bug-in-big_endian-os.patch and it can be found in the queue-4.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From ff18143ceed3424b7d6cdb8659b9692fa734f0d8 Mon Sep 17 00:00:00 2001 From: Pan Xinhui Date: Wed, 20 Apr 2016 14:41:00 +0800 Subject: sh: cmpxchg: fix a bit shift bug in big_endian os From: Pan Xinhui commit ff18143ceed3424b7d6cdb8659b9692fa734f0d8 upstream. Correct bitoff in big endian OS. Current code works correctly for 1 byte but not for 2 bytes. Fixes: 3226aad81aa6 ("sh: support 1 and 2 byte xchg") Signed-off-by: Pan Xinhui Acked-by: Michael S. Tsirkin Signed-off-by: Rich Felker Signed-off-by: Greg Kroah-Hartman --- arch/sh/include/asm/cmpxchg-xchg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/sh/include/asm/cmpxchg-xchg.h +++ b/arch/sh/include/asm/cmpxchg-xchg.h @@ -21,7 +21,7 @@ static inline u32 __xchg_cmpxchg(volatil int off = (unsigned long)ptr % sizeof(u32); volatile u32 *p = ptr - off; #ifdef __BIG_ENDIAN - int bitoff = (sizeof(u32) - 1 - off) * BITS_PER_BYTE; + int bitoff = (sizeof(u32) - size - off) * BITS_PER_BYTE; #else int bitoff = off * BITS_PER_BYTE; #endif Patches currently in stable-queue which might be from xinhui.pan@linux.vnet.ibm.com are queue-4.7/sh-cmpxchg-fix-a-bit-shift-bug-in-big_endian-os.patch