Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1294378pxb; Sat, 17 Apr 2021 12:52:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4lC3MPDP2kHLH87V184nPxMS5TAO3oFU4G5gEoje7/X+TBCm4B7YT+hruglZAThY/TkZD X-Received: by 2002:aa7:cd51:: with SMTP id v17mr17032944edw.137.1618689179133; Sat, 17 Apr 2021 12:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618689179; cv=none; d=google.com; s=arc-20160816; b=thPyzqZ2UlEwiJGdH2NCsi7aKDoWnsZRsnJ5Ocv4xtVY+TUVLmxOMjUYDHH93S4aiB XIsEbRDYsOfe2mu553FOKVA0/uAiFnuVCSYFx4pJB5zF3+zvBfqOPCHZ6hQuh6fuZjq8 F9gB3fKEODSaco7KIARJ6QPqs1YqlVzt+SuGs9jS7lUb+Xttb88d/EiR7T1A8uZFuJ52 kAeMNxXj6LY4nJJbtJFCj0him27XXNgg3ZvkrmUogd/c6G/2Adcmp0b72y+Hgqqe+eih wbRddrnxhmCG4Vu9r3uFXX9jx5uPU3noWDOOlClgOG6SOODNR1RsFFBxP6YaDsQjkR9Z nh+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=V9GAEUssANBfKD15rSozAJHNG7J93nIDtHCydhPvEyg=; b=wojh4rEXwShIxDObH1qIf6b6Mx3mKXPTPfrAbYgp9OEbN7lLLvajlOgB+9fq7MVOY6 rlD+T1s/tH1lBRv6UFHoNP9gXqjSLJS5F76IKDfaySxAEmZRa3DJrb6/adYWPiCNhYnu sbYJRB+D4fRaD/1RrshD9LaO5jcG7Wfcfi9KXrcpqPNHjdZkgo298HqRkvakYWgfy893 H3I+mn2y57Y4MRSQKAbDHaD1EVb4iBEEupqcvdWYUdB6w4JxSUOV4QpLz+3/lXL31S1f Aj13Btu4DH75ALZBqTXwIcB8BStqJ1TDnmiH+FA4Ledw1Z4FY81E5+phNiyJ6iSm6Lq2 SBUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Bg7f0TZ9; 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 gn42si8582857ejc.715.2021.04.17.12.52.36; Sat, 17 Apr 2021 12:52:59 -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=@linux-foundation.org header.s=google header.b=Bg7f0TZ9; 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 S236977AbhDQTwI (ORCPT + 99 others); Sat, 17 Apr 2021 15:52:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236718AbhDQTwH (ORCPT ); Sat, 17 Apr 2021 15:52:07 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50B96C061574 for ; Sat, 17 Apr 2021 12:51:39 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id y4so9772525lfl.10 for ; Sat, 17 Apr 2021 12:51:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V9GAEUssANBfKD15rSozAJHNG7J93nIDtHCydhPvEyg=; b=Bg7f0TZ9VMkODVodUxo6nOYaLPNAtK3zo+8R5f4drYQz4zXcV5xMh95M/iaSrGrgUl ZQoW0aZRgSG/dI0D896jjYc5BzE9mebQvnUfvzEIIjN66tZ7KMqZeyvGYfU/aoSkEzHj Kw2aAnXTdbTXACWkyPkvRbmvBcrIzVsjGat5g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V9GAEUssANBfKD15rSozAJHNG7J93nIDtHCydhPvEyg=; b=a18MOlWvdKwS4PNeMOoRXx1qG4/+E+iTaGOeC1YjeQo5jBvzzZ1W7QZVQS43yo3Xv1 Ph3TwLcXg8z1W2BzC0tW0c3xjlkC2yOrcJVacLSUqdEeTDvhWTR8wy/DTzHBS+rVZr0+ B3oflNi+suf+I3EV1PM08rX7gNE7H7VlAZ9q2xuAl4vmuApR5+xTexkwbEmp6HFw3p7u joh5jS5LpvnLlsX2/j2G47fDdnXXaBJFrzTjg0FIya5YFBP1p0scCvpVgXRaisNiWu0b dYQ5zz1o5bNsYTymH2p+vq0Dwkdp0xUi+zAPPlJzt3nyEWrQyq4Mrk1Q7ce9qyHCdjTY jMGw== X-Gm-Message-State: AOAM532C83GcLz/XkQd6PH9WGbyxOP/gW+VFi0ZrCpF5rSdgUEvKPoQy njgHmydsgYSIWaaMvjLA0xJOHNMfP87+ls99 X-Received: by 2002:a19:e20a:: with SMTP id z10mr6974192lfg.391.1618689097573; Sat, 17 Apr 2021 12:51:37 -0700 (PDT) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com. [209.85.208.181]) by smtp.gmail.com with ESMTPSA id c2sm1358588lfi.143.2021.04.17.12.51.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 17 Apr 2021 12:51:37 -0700 (PDT) Received: by mail-lj1-f181.google.com with SMTP id l22so27477508ljc.9 for ; Sat, 17 Apr 2021 12:51:37 -0700 (PDT) X-Received: by 2002:a05:651c:3c1:: with SMTP id f1mr6240560ljp.507.1618689096862; Sat, 17 Apr 2021 12:51:36 -0700 (PDT) MIME-Version: 1.0 References: <20210416192413.1514419-1-eric.dumazet@gmail.com> In-Reply-To: From: Linus Torvalds Date: Sat, 17 Apr 2021 12:51:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/uaccess: small optimization in unsafe_copy_to_user() To: Eric Dumazet Cc: Eric Dumazet , Thomas Gleixner , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 17, 2021 at 12:44 PM Eric Dumazet wrote: > > I thought put_cmsg() callers were from the kernel, with no possibility > for user to abuse this interface trying to push GB of data. My point is that "I thought" is not good enough for the unsafe interfaces. It needs to be "I can see that the arguments are properly verified". That is literally why they are called "unsafe". You need to make the uses obviously safe. Because the functions themselves don't do that. Linus