From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795031020; b=MJ0W8frsH8rBhDW9Tkc/kSp7td0aDlGhVn431LQwSyvmruRPDBdPgQ4FyFBMoHN5JhbN WL2ZnV15o5S/Au+l7KFeM/H9yqg0PfpZoQrRyfjVdwuK0W4iZOPPu77EOvM1r9TZnEvDw qHeUXB1vYfJKK6QtJGGXRj7KP10HITUJax+2GVjDugbak90niAdEwOpt05+/9bmGOTD8I BolrCqjmt5Dx5eGn6ddWmB51LFH+TlP9Npf/TY8/YcnhKEEi4Wl9vThqnlx+WCZtowwis er3dmwKPfFhpwuNcmH1PXtJgKq5fLVxOWOr26A8hNAg0HWAdOwwmQQQ919iO+XGiGWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795031020; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=CHg39mnkOpbqRBU/zLEa1ZaxLfT2S29EP+WYqql0lfQ=; b=il2B3o96hnVeD2twHkJmCuWr+duxLdGuFbIdJw/wbDXNctODM5A7LtjzWHXzKDegOwPt EULftMGYN/imhXMnC/yeOixNxjpmYBhVJmSj9iJkgOIWHwKLRUKLdRK10JNIljztY2YrS gFJm8++C55mVlZhVJD3I9YTWeTLyK/y1DHOo8lXqGTlr47s4FfmyQYZiRETPIbtifMY5V nl9vUXuTXR90on5t9EGKpEHDIOVgv+mQQQGKbluZvNcpPOex0kdHEKj7on7MaGnu1bWJU 7hkY03vHK2jZmH4XxCGcDoyplfpcOxobvHmZ1itkCPH6thGoT8W29d4O9kmWxeyW91w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yFarVqUM; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36A03606A31C; Wed, 18 Nov 2026 19:43:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yFarVqUM Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FBBE1F000C4; Wed, 18 Nov 2026 19:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795031020; bh=CHg39mnkOpbqRBU/zLEa1ZaxLfT2S29EP+WYqql0lfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yFarVqUMPeTeLMewaPEjfUPHjlKCdOgnF82oBjgXgOfO6gySNu36FZJ8784VkWjT5 Hj0Dfs/VGySPxh38ZqYs8UgwFr6JYuo+4XD5kMpo3rrfH9Py0wVyJGJIFKL09TkCKg RuXipffSsX1NMrgTfvVMUQU0vi9OUEt2JE6A7V/8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Florian Fuchs , John Paul Adrian Glaubitz , Sasha Levin Subject: [PATCH 6.12 0909/1756] sh: uaccess: Require offsettable operands for 64-bit user access Date: Wed, 18 Nov 2026 15:50:36 +0100 Message-ID: <20261118150046.158549073@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150007.957976754@linuxfoundation.org> References: <20261118150007.957976754@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Fuchs [ Upstream commit 8b5dba9ea4a3f5ed994f03d6ca7686c49491b426 ] The 64-bit __get_user_u64()/__put_user_u64() paths address the memory operand as %T2 (base+4). This base+4 requires an offsettable address, but "m" also allows the indexed mode @(R0,Rn) (e.g. for a variable- indexed array element), which has no displacement field for the +4. Depending on optimization this build fails with "invalid 'asm'" or an ICE in GCC's change_address_1. Require an offsettable memory operand, allowing GCC to reload an unsuitable indexed address into an appropriate form. Fixes: 2d2b308a8b7d ("sh: Implement __get_user_u64() required for 64-bit get_user()") Signed-off-by: Florian Fuchs Reviewed-by: John Paul Adrian Glaubitz Signed-off-by: John Paul Adrian Glaubitz Signed-off-by: Sasha Levin --- arch/sh/include/asm/uaccess_32.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/sh/include/asm/uaccess_32.h b/arch/sh/include/asm/uaccess_32.h index 5d7ddc092afd7..cef40414bfb13 100644 --- a/arch/sh/include/asm/uaccess_32.h +++ b/arch/sh/include/asm/uaccess_32.h @@ -92,7 +92,7 @@ __asm__ __volatile__( \ ".long 1b + 2, 3b\n\t" \ ".previous" \ :"=&r" (err), "=&r" (x) \ - :"m" (__m(addr)), "i" (-EFAULT), "0" (err)); }) + :"o" (__m(addr)), "i" (-EFAULT), "0" (err)); }) #else #define __get_user_u64(x, addr, err) \ ({ \ @@ -116,7 +116,7 @@ __asm__ __volatile__( \ ".long 1b + 2, 3b\n\t" \ ".previous" \ :"=&r" (err), "=&r" (x) \ - :"m" (__m(addr)), "i" (-EFAULT), "0" (err)); }) + :"o" (__m(addr)), "i" (-EFAULT), "0" (err)); }) #endif #define __put_user_size(x,ptr,size,retval) \ @@ -196,7 +196,7 @@ __asm__ __volatile__( \ ".long 1b, 3b\n\t" \ ".previous" \ : "=r" (retval) \ - : "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \ + : "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \ : "memory"); }) #else #define __put_user_u64(val,addr,retval) \ @@ -218,7 +218,7 @@ __asm__ __volatile__( \ ".long 1b, 3b\n\t" \ ".previous" \ : "=r" (retval) \ - : "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \ + : "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \ : "memory"); }) #endif -- 2.53.0