Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp969019rdb; Fri, 9 Feb 2024 06:41:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWLtP9jBOJUmAsm6tcYiJ33xQ3Ak2J5wfZPV7LDTQBW0YMVRcL4xQdqi92JN8vQW7vYRaFwJF5sbCT+esYU2R3k/ACCt7+810L7lroIOw== X-Google-Smtp-Source: AGHT+IHdgbPwJOtQOWFDrxinoGLXOdaMeR+GHm05jizA5ppkvw/0QaAjrHYihsV3HwnCf7vnIT6+ X-Received: by 2002:a17:907:944d:b0:a38:1a75:787d with SMTP id dl13-20020a170907944d00b00a381a75787dmr1454679ejc.24.1707489712863; Fri, 09 Feb 2024 06:41:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707489712; cv=pass; d=google.com; s=arc-20160816; b=Y3/v/mrjDOVbSCA3kRdSxa2+v7BJDN4d57JG6exT8n3VBlGjhSzFr1uEeJqS2sPXLU Y65Ks0NVdAoBqu/HG0GNWM36hq0giggtvgVZnX+x8JEygsYgR/JIXOtBVNerqLoPqGPC /kklE2JcdfBIKrZsA5mOHwShvIokNDZV8fTwEif+oRnqPNV1mIupMrIbJFLPW8rsMKPo TaybKe3AAA1RbX1HuRRu98gabw3aRGOJRVEMyTdPwuFWiQxraO2PzfV9OWCaS7P9q4nB bnYFS8zJduELSx7BYfJRY4HmgX1o5uBGidcyY2NXyeEUzRXfQ6LXjcEV1/xQFThPAFxh KKxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=RfpXrOgPMBuIAQYXOAV94jbrpi1e3bUYrcbdSK52a14=; fh=d46lj/ZZHkmJXnkpIghzQVD0g6eTiwbdCmIMGKmtxnQ=; b=UDqudIDwDG2wsOXAYjacJo0z11nMsGU6HbOM/0+1isMHiQ+Eycai1UTZyi91rJuNtt xYtA4UpFQ4epgM6me41Udb5RWK9oMDtisinAWEpMucmmT1qLTL4lbgsUrPj8JXvJDWvD MfdHTWFwNnPNUR94KlA0LyWuwu0yTFKV9Do0sQLUSZMEKHDNeXOHiY6fqqu6uogdgoML nVppB5ZXCl8GHtVX5X9PuO8qCWeX4332+FDd01kQDXhDRZp2ZU7LjKTayqpGPNeHHSKe gawrYpP+TA/28VzjHBwoRB2RnmR0J+Ea/CjuiCzkq9dKovXpRfzxS3Nq+fWDivE5k/Sp mZbw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b="S3/XM1R9"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=v6EPGKHY; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-59484-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59484-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de X-Forwarded-Encrypted: i=2; AJvYcCX+31iPSIv/bdkPsq31yVk7TQvzALk9dQurUcSjECcUNCeEIFJBvNdezufqocxZJVwSBIkygHVI4kAABP33nS0iB08qOQykWS5Nh3fUZQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dv23-20020a170906b81700b00a3852f137a1si910529ejb.764.2024.02.09.06.41.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 06:41:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59484-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b="S3/XM1R9"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=v6EPGKHY; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-59484-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59484-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 91F761F22549 for ; Fri, 9 Feb 2024 14:41:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0AEB06996C; Fri, 9 Feb 2024 14:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="S3/XM1R9"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="v6EPGKHY" Received: from wfout5-smtp.messagingengine.com (wfout5-smtp.messagingengine.com [64.147.123.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D56E44C83; Fri, 9 Feb 2024 14:41:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.148 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707489704; cv=none; b=s4tsOZxZIKR+ddrXroVeYgnox46VeCMnSR5yUqrIRCbHdg3oSXOZIdpRcm9PqfinCvKnlPm4ubi3N8jkfSB4RKDZNoIkvKLrd3Hyx8irkjPrlIXBfpMl1neuIDhzrBRVG4EDv76sOePsWbiuQ8DNtAYqLHeizhsneD15LlkXg+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707489704; c=relaxed/simple; bh=MdgKh1QKbxz534VY+pTpXg0oSXnXmtnExQPKXVZLegg=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=Y1sOVDPlnfHLNN3nh0pBwGEhBQkQZ7DJB/CEXm6RAQuTAtyImmfo8PA/bKDp+inl9v8Sbnzq5mmeVXhPsQ8Ebm78qIjyUObvlzj2SKps1BkrFK+htjGmJh1WgGKLEMvxHRoymjAl5ygca1VzekTeu6hIVTS47BJcjfrvYYmH1ZA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=S3/XM1R9; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=v6EPGKHY; arc=none smtp.client-ip=64.147.123.148 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id D10021C00085; Fri, 9 Feb 2024 09:41:29 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Fri, 09 Feb 2024 09:41:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1707489689; x=1707576089; bh=RfpXrOgPMB uIAQYXOAV94jbrpi1e3bUYrcbdSK52a14=; b=S3/XM1R937Zow+EapKrmWrZWju diAdGAnkld0Pkg5Y3H5ta2KRc32i3bs6UHmWXjJ6NtqaG15M4eO8F4QEPDxa1/8j Fg27pEJJzRJrhNVYwlb+ieC8wA82ig5CA1unleV78rWuBtffnAikF3WENDrb3Atc yn2eqXaKNOMugVWSp6mfMKMgo4gm/ACus56pQocWfQRro/Y+Rhi1q6HiIGeW4AZ+ 81jJr1mUz4oAT7010oseOisWz03m2xn60LRs/V2xsPFsqq9eyO8BAQdJYA+TiDz4 +42zSDXqWF5sRpegf4i5/Yz5gZ2UHbX/sgxgn5vSHTRN+oI8RzfMnXzKAHHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1707489689; x=1707576089; bh=RfpXrOgPMBuIAQYXOAV94jbrpi1e 3bUYrcbdSK52a14=; b=v6EPGKHY+rqQ4ZeZt2i1OZF5oPBc/x3vybijI4oM5RGT eTIzOUUchqL6HX1MilRT/Z1ZRvlucEMX9ZiRND8XMsbyXrFC4mEgz+QlrE2fjVj2 MTS/Se9MuD73i4derA5n9T+lXGZraTa8/5j6fZkqNZd4BBJGyapd/M/bwJ42N4IN 8e84WiKF95alnZae1PsL+Qs+O1HM36k2J1pHpa/Ta4qyNYpPP5ch1yBpCavfC1Vp FlpSKlPWoHcIqmdG3tL263GTmEV1D7qejeHkNRO3xsjQt2G2ZM5zr31ea4BeAa7R XOS3lhVxVZAx5+1IUOgq6oeEtIs28FI9qZjiStrxww== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrtdeigdeiiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 88BFEB6008D; Fri, 9 Feb 2024 09:41:28 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-144-ge5821d614e-fm-20240125.002-ge5821d61 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <6eeba3ce-d66c-45e2-8c34-ad0109ec2ef0@app.fastmail.com> In-Reply-To: <20240208225608.11987-1-kernel@valentinobst.de> References: <20240208-alice-mm-v2-2-d821250204a6@google.com> <20240208225608.11987-1-kernel@valentinobst.de> Date: Fri, 09 Feb 2024 15:41:08 +0100 From: "Arnd Bergmann" To: "Valentin Obst" , "Alice Ryhl" Cc: "Andreas Hindborg" , "Andrew Morton" , "Alex Gaynor" , =?UTF-8?Q?Arve_Hj=C3=B8nnev=C3=A5g?= , "Benno Lossin" , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , "Boqun Feng" , "Christian Brauner" , "Carlos Llamas" , "Gary Guo" , "Greg Kroah-Hartman" , "Joel Fernandes" , "Kees Cook" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Martijn Coenen" , "Miguel Ojeda" , rust-for-linux@vger.kernel.org, "Suren Baghdasaryan" , "Todd Kjos" , "Alexander Viro" , "Wedson Almeida Filho" Subject: Re: [PATCH v2 2/4] uaccess: always export _copy_[from|to]_user with CONFIG_RUST Content-Type: text/plain On Thu, Feb 8, 2024, at 23:56, Valentin Obst wrote: >> -#else >> extern __must_check unsigned long >> _copy_from_user(void *, const void __user *, unsigned long); >> -#endif > > This function is now unconditionally declared, but only defined if > `!defined(INLINE_COPY_FROM_USER) || defined(CONFIG_RUST)`, i.e., in the > common case where it is inlined and Rust is disabled this can lead to > link-time problems if someone decides to use it. Yes, that is intentional. If someone tries to use it when the declaration is not there, they just get a compile-time error, which is not all that different from a link-time error in practice. It's unlikely to make a difference here, but enclosing declarations in an #ifdef is annoying when you want to reference it from somewhere that is parsed by the compiler but not called without the respective options. The if(IS_ENABLED()) and PTR_IF() constructs in particular only work when the unused functions are still declared. Arnd