Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp141734ybz; Thu, 30 Apr 2020 18:12:39 -0700 (PDT) X-Google-Smtp-Source: APiQypIG6TeBG2HbQlNt/0EXZkmpLRc5eB52K9rWKFGDipJtgt+ty/dfyQx4KN5ymfpMhmYhabpo X-Received: by 2002:a05:6402:1a33:: with SMTP id be19mr1640216edb.214.1588295559270; Thu, 30 Apr 2020 18:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588295559; cv=none; d=google.com; s=arc-20160816; b=LTF8Lew/gFeE4g3uQuZ6Z3TSXF8x534ziQtZJGwOVVK8trRu45tBuoGlDQOX/D9DLO W/zbGtgRfJGrdebUX/suAU2uWSxCCocIgVem12JPb/y1avuSK3uvn3qvsoamXqDmjr4I 7NoM8kpUPQsgu/ysjGt0+b+4fhU229M/H/V6rlUO9AywbIZZViHhr1k3SO9JwwiOzPn3 HM1ScvT5fvpqU/COnkfCBhvvbYavuyvP/lBQA2C7A8HimebAjsSo/ofcEnKD1jXauBJJ 9/waXmnrpnzT58u/M+5UZ7iEzWIKBYZ07JT5+LuSi+M9g5ufQlWo44nJZJXPm77PUT4T QWDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=k15OpOeoQ3rmzh87tU7V+M2stfR65Ddwc7t7jeSZ6rI=; b=uPqTZvvBB3o1m+z+gTkV+BFgXuV6lAorqtMXcUkfSOgnLx31QeuHDI3wZ99pUKrTML 0vQN/WIdv+iQ+Hml5RxKZWY8da6MBjLwPSXw0ksT9e5kFg9ttUPgkU+Vuy8OOhHQ8rJS zawOuH24snmog7BJlUDpYmzezFb9Rh8ul2Pbdb3YBEPovUFNrtoACJyP/eLuPFuNdx3+ eZCR7HCmRZP+83TENTIbiu8/rcyMEUICqFYQOgXYWhmrtzgY6TQ/qZg2JiUOhH6oDEJg /GKqKxnHiluMLCw39F6YaIw15r5GQ7ut6Gt0xb4D1BtlGHQX1N3V99yEpFQjhIl7igEM 445A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=ZLa2+csE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si849242ejr.170.2020.04.30.18.12.16; Thu, 30 Apr 2020 18:12:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=ZLa2+csE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728068AbgEABKM (ORCPT + 99 others); Thu, 30 Apr 2020 21:10:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727114AbgEABKM (ORCPT ); Thu, 30 Apr 2020 21:10:12 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEBB7C035495 for ; Thu, 30 Apr 2020 18:10:11 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id h12so4179236pjz.1 for ; Thu, 30 Apr 2020 18:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=k15OpOeoQ3rmzh87tU7V+M2stfR65Ddwc7t7jeSZ6rI=; b=ZLa2+csE7C3ftsRmz/3+xOMLvS/uMepf5whKkn8d0OzfNoAxs3NYCmP/f16enqaROD JXZtPTYe1UyUJ/8SMeBi91XE6HWT6NlMiR35fFnnS7pvY3G7mtAEbbz5XTC/gox9CeWD eiReEYv/wwrQc3YopVZRokis2rX/nm1PfgdSC4RCTLPAgTawOYwjMf5cvk1BtVdwvXJ8 uGNOUfjzRolRhppVNHd4kWTxIHehl5ULT1jNZb1WnV7sL9d3eiUzPkPD4f6tnuQ14q06 +fnZlk8TLV+1KRT0DC5j0jC9LPU+s7Jmfx/bn3uiN2FV8qzlbJXUjdcVZKGkx7i8RNOE URiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=k15OpOeoQ3rmzh87tU7V+M2stfR65Ddwc7t7jeSZ6rI=; b=glIRZQtDfdXfNGkVpDZyhARwadgYRgj9Tf6gKWJ5t+wWxXMVzYOKSvu8T4ihIBn9T7 PP33exeGqQcwADxTnD2CPfrMKw7AdmskQDv1SFg0tnuMMrEmoqOmjlsmz3wq8IVpzKja M8KO4bHRBg8miZJmqZeeAXGk0ITB54dZk611uDHJSs/oRPs3b5gl28KpI3rcMnb4BLfu GrS6WZ2brSirhz+EkYq6w4Uw8DDKMFJupphqv165CsZ4/1beEDc9u7nMc0VqAm/3AzID VzKmFxOSws1/4epTngNQ8Rv7yxLTXF+RUct8XH6OnCuzICyc+mfRPYzoy2uSJWfBum6l mj+Q== X-Gm-Message-State: AGi0PuaBlzpoYBiST5fMvrN0YaPNVkYTZQknFtcxtfo3bREV487rHsXZ SVWRw7Q/lFv+dgUKsxZ4X8aK9g== X-Received: by 2002:a17:90a:2526:: with SMTP id j35mr1791482pje.98.1588295411228; Thu, 30 Apr 2020 18:10:11 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:d495:581b:d692:e814? ([2601:646:c200:1ef2:d495:581b:d692:e814]) by smtp.gmail.com with ESMTPSA id y13sm818856pfc.78.2020.04.30.18.10.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Apr 2020 18:10:10 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v2 0/2] Replace and improve "mcsafe" with copy_safe() Date: Thu, 30 Apr 2020 18:10:08 -0700 Message-Id: <1AA57F55-0361-4230-82B3-B432C40C0DBC@amacapital.net> References: Cc: Dan Williams , "Luck, Tony" , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Borislav Petkov , stable , the arch/x86 maintainers , "H. Peter Anvin" , Paul Mackerras , Benjamin Herrenschmidt , Erwin Tsaur , Michael Ellerman , Arnaldo Carvalho de Melo , linux-nvdimm , Linux Kernel Mailing List In-Reply-To: To: Linus Torvalds X-Mailer: iPhone Mail (17E262) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Apr 30, 2020, at 5:40 PM, Linus Torvalds wrote: >=20 > =EF=BB=BFOn Thu, Apr 30, 2020 at 5:23 PM Andy Lutomirski wrote: >>=20 >>> But anyway, I don't hate something like "copy_to_user_fallible()" >>> conceptually. The naming needs to be fixed, in that "user" can always >>> take a fault, so it's the _source_ that can fault, not the "user" >>> part. >>=20 >> I don=E2=80=99t like this. =E2=80=9Cuser=E2=80=9D already implied that b= asically anything can be wrong with the memory >=20 > Maybe I didn't explain. >=20 > "user" already implies faulting. We agree. >=20 > And since we by definition cannot know what the user has mapped into > user space, *every* normal copy_to_user() has to be able to handle > whatever faults that throws at us. >=20 > The reason I dislike "copy_to_user_fallible()" is that the user side > already has that 'fallible". >=20 > If it's the _source_ being "fallible" (it really needs a better name - > I will not call it just "f") then it should be "copy_f_to_user()". >=20 > That would be ok. >=20 > So "copy_f_to_user()" makes sense. But "copy_to_user_f()" does not. > That puts the "f" on the "user", which we already know can fault. >=20 > See what I want in the name? I want the name to say which side can > cause problems! We are in violent agreement. I=E2=80=99m moderately confident that I never s= uggested copy_from_user_f(). We appear to agree completely.