From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11DA6C433B4 for ; Sat, 17 Apr 2021 19:51:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D617D611AC for ; Sat, 17 Apr 2021 19:51:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236994AbhDQTwI (ORCPT ); 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-Google-Smtp-Source: ABdhPJxlnDQsGdwxwqRpDJKVMUjn/P43Y9JTH6WFEJkaY8WDTL8p4gWoHBbcfYicrxP1MtLeoLC4BQ== 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