Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1981255rdd; Thu, 11 Jan 2024 15:58:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IESqkVLKLFq/4s7WPCSHhW7cnJmUx8aYknnj5UgY03PgqLSX/egl/gxLuMXVyhTd4D9RHXX X-Received: by 2002:a17:902:e808:b0:1d5:5844:6d66 with SMTP id u8-20020a170902e80800b001d558446d66mr120894plg.43.1705017508097; Thu, 11 Jan 2024 15:58:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705017508; cv=none; d=google.com; s=arc-20160816; b=HszUpsd/aFIN7seiReYa5z2Ht+V0TLUd0nKeju7bAIVhxxZ5mtAkzJ4HtTpaUbK2Qf X4cxsnaW2eUydOz3l8Nk77bVeCsnRnoN4uYTaSaJ5s7UlWXx4IfwxQTEEyl563uDjVSj JE2Z/nnMCxHDPgCVD3xwMgDWYeHWqhkZssC9Sgn6szjb0dPJ1Ef0sAZ2hoJ8H9Jl9lLL 4hAdYYCTQd1/aSq1Qou37/NeMJMBzjq4/ZYq/7vzfNTMVPLUog3rusoYkc3XopTneuaC z7YuXY2lfVhviueYZpqU0hWmRWANz/XBbs3Ene0PRVEYNGWvQ8RBvmXX5XmWlAtYpZkr wueg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=BDi6Ytr3ZF7kMqGhTfpaqY3ixKYJEHofwLcUk7xKkJA=; fh=gD8avVJmidhiz5RIWOdhue1CTAYQfiOs8E86cOXCWIg=; b=zSd+j9GrHyBdRKgMwz82b59/pr+XB85uHQRxFd+5ms3hJksDA2stScM2TaLEvt4B0v LVV9QHtgjSwD1X1lrFy+ymMSL5+LbupyCerxw7LB+2XSmLrr3RzAw/73nchObGjy77jS 9NcGoB55oG1TtH+BgaMp2qRWKAwr1mJwEVhGTLxjMzNeQO6VtLUbHr4D36KYqwNzyone tZhwPLpuv/2ecHL6J7/v8egTDN6tGVPdYOhmB8LNIgJi2paw0ob4bjO9bRE+Bi94tEut o0lem7m5bcej86xIUGf1Osqxtfbhvj97u2OKYQH2Vj0mudsgCurtF6+f7OL2pZredyF1 N04A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BQBnr2ku; spf=pass (google.com: domain of linux-kernel+bounces-24153-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24153-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id jg21-20020a17090326d500b001d58cbc863bsi1963397plb.167.2024.01.11.15.58.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 15:58:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24153-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BQBnr2ku; spf=pass (google.com: domain of linux-kernel+bounces-24153-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24153-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 647BDB23DFB for ; Thu, 11 Jan 2024 23:57:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21D595A0F0; Thu, 11 Jan 2024 23:57:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BQBnr2ku" Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8495BFBF8; Thu, 11 Jan 2024 23:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-dbdb124491cso4695898276.1; Thu, 11 Jan 2024 15:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705017453; x=1705622253; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=BDi6Ytr3ZF7kMqGhTfpaqY3ixKYJEHofwLcUk7xKkJA=; b=BQBnr2kuTvRktE3LNT7QLLH/sqZP3NduXLwFTPsfnVhDRDS3oFStoEEbV6SqzK72gx M8XUbsiFuR3fY2GcAEyBznXIWtmW7fYfzpVpG2RSIeXA2KH5GbxE/rr3zwFSSGDBfBpi yqYCkbSsan5GPu9GQC25w5b3psX/prcNAuCRtJ/Cm1o+8Z9H/1h3wlI4YlSPVqyBtYw7 xChwlhmQJsP4IDXeFUtPmlgCjw4PyyqRrIbAJw3B6lbUhGkHgrO6RAwaXF66rItk+vBS df9Hz+lacYuFBF8p9V16S+X7vgo2h9NbWzqqsQe6/glMftO+Kk1lXgr2/rv1fUxwVM0J /Qog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705017453; x=1705622253; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BDi6Ytr3ZF7kMqGhTfpaqY3ixKYJEHofwLcUk7xKkJA=; b=OZBdfcleKbr3X163eZa5o5CP88UrMfVgeyDVbr4lvjhiKPNW1UNT3XfsM49du4ItKc E8A0ws6V9+nMRHd26s8AOD3XOTEAyt5mfhMF1d0ap2hKHta0WkDbyDYaA+6dMulfmkjD YiuWCsi/Cqyhp/2RvOjQDEuvXYJTnbQrS1+XyL8mSYDnIR8Uw1PowzzlZdRwM3HfXbBD R7E2UfDGj4CGEdkHp82gcPpVdrquGjIWEhLkm0vOD6pktPbYUAGzXBfbzOeU5TMif7/t fqkX6uUz0mZX/q5Q8ouD+2QMYf2i9LE2MLbxrfHwLoHTxyiNb3pxLDPTY5qCboZu65nT ZCAA== X-Gm-Message-State: AOJu0YzzWAVCBed2H6f0vdOb0/C+G86WcYzWBjbaMd+KVfGih+ScEx2r RJ2vSoLnxtwIbps7NvzExpgXpFzeThc= X-Received: by 2002:a25:ad48:0:b0:dbe:3b74:5f73 with SMTP id l8-20020a25ad48000000b00dbe3b745f73mr45446ybe.51.1705017453382; Thu, 11 Jan 2024 15:57:33 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id i3-20020a056902068300b00dbcd92f26d4sm745983ybt.20.2024.01.11.15.57.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Jan 2024 15:57:32 -0800 (PST) Sender: Guenter Roeck Message-ID: <77b38aa7-a8b1-4450-8c50-379f130dda16@roeck-us.net> Date: Thu, 11 Jan 2024 15:57:28 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 5/6] add listmount(2) syscall Content-Language: en-US To: Linus Torvalds , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org, linux-security-module@vger.kernel.org, Karel Zak , Ian Kent , David Howells , Al Viro , Christian Brauner , Amir Goldstein , Matthew House , Florian Weimer , Arnd Bergmann References: <20231025140205.3586473-1-mszeredi@redhat.com> <20231025140205.3586473-6-mszeredi@redhat.com> <75b87a85-7d2c-4078-91e3-024ea36cfb42@roeck-us.net> <2f595f28-7fcd-4196-a0b1-6598781530b9@roeck-us.net> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9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k1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/11/24 12:14, Linus Torvalds wrote: > On Thu, 11 Jan 2024 at 10:57, Guenter Roeck wrote: >> >> Any variance of put_user() with &buf[ctr] or buf + ctr fails >> if ctr is a variable and permitted to be != 0. > > Crazy. But the 64-bit put_user() is a bit special and tends to require > more registers (the 64-bit value is passed in two registers), so that > probably then results in the ICE. > > Side note: looking at the SH version of __put_user_u64(), I think it's > buggy and is missing the exception handler for the second 32-bit move. > I dunno, I don't read sh asm, but it looks suspicious. > I wonder if something may be wrong with the definition and use of __m for u64 accesses. The code below also fixes the build problem. But then I really don't know what struct __large_struct { unsigned long buf[100]; }; #define __m(x) (*(struct __large_struct __user *)(x)) is supposed to be doing in the first place, and I still don't understand why the problem only shows up with CONFIG_MMU=n. Guenter --- diff --git a/arch/sh/include/asm/uaccess_32.h b/arch/sh/include/asm/uaccess_32.h index 5d7ddc092afd..f0451a37b6ff 100644 --- a/arch/sh/include/asm/uaccess_32.h +++ b/arch/sh/include/asm/uaccess_32.h @@ -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), "m" (*(u64 *)(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), "m" (*(u64 *)(addr)), "i" (-EFAULT), "0" (retval) \ : "memory"); }) #endif