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 E5741C433EF for ; Mon, 13 Sep 2021 20:10:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA69E603E7 for ; Mon, 13 Sep 2021 20:10:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242817AbhIMUMB (ORCPT ); Mon, 13 Sep 2021 16:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236133AbhIMUL7 (ORCPT ); Mon, 13 Sep 2021 16:11:59 -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 AE512C061574 for ; Mon, 13 Sep 2021 13:10:42 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id l11so23616464lfe.1 for ; Mon, 13 Sep 2021 13:10:42 -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=146IDoLHsnlYB84TPDL7kqzW39fi+lkR3958WvJksNU=; b=gyRS8gjhHVDEJW3sWIFVBpPRc2KEVEPHvvR30CLnqsK+D0Cdnc2iMmALs9/mMesYTx DWIkQLMkgDI0IL1b4WvgD65bkxCoJcXYobVOE4MVrZsCt0d4JU3u0ngT8fARn6axUyBf W1N+PxcICKOZsZfThMM7E97Qm8F9LSOpst2ww= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=146IDoLHsnlYB84TPDL7kqzW39fi+lkR3958WvJksNU=; b=2DWZbYuyuCVSc4eLzARXHor+B93wKBSF/0ySh21OFPijcBcITuGRofEfFB1VPycQtg LUe7KpGHS/8u02TNtc+mChmueBUg+0OVnMWqhBBR1rO1se2dzK7m4pefbgDNBh3eNtnY hBfN2ZIJ2Y0qUcfvD94iMq1flFPGVMigEorgFqOJfNRTAprxCk5kwz54rc7rsoPurv6B cM2uuzwFpnYKcGt1WLDqgyMAfc5FNQL4R8lrFEkkz1Vs7bmU3O3N1pvG9ismYxqdQm3K h3NkLN42rdVozPXgFfKjg8qBC1DegPzL6dBqDyoICE+sDYap2oGnu2YhfhbkCG8gQd7A H4yA== X-Gm-Message-State: AOAM531HzzaDbGENvmngmD3ed0AdbuLN14YbMYX8wqVZdtki4uUf19m6 Q99FWXEFZBHlOTc94mHgGmc1xJJvb42oqmq6rS0= X-Google-Smtp-Source: ABdhPJwSD8TNabFV0c9HoIUGBYhm/o8ebkQOrWC1BT2Z2yYAHrwfxYyRSW8rkNhgvmRINg7Q+OtUYw== X-Received: by 2002:a05:6512:3b94:: with SMTP id g20mr10439356lfv.409.1631563840524; Mon, 13 Sep 2021 13:10:40 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id p5sm918272lft.302.2021.09.13.13.10.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 13:10:39 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id s3so19414833ljp.11 for ; Mon, 13 Sep 2021 13:10:38 -0700 (PDT) X-Received: by 2002:a2e:1542:: with SMTP id 2mr12239121ljv.249.1631563837811; Mon, 13 Sep 2021 13:10:37 -0700 (PDT) MIME-Version: 1.0 References: <20210913131113.390368911@linuxfoundation.org> <20210913131114.028340332@linuxfoundation.org> In-Reply-To: From: Linus Torvalds Date: Mon, 13 Sep 2021 13:10:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 5.14 018/334] nbd: add the check to prevent overflow in __nbd_ioctl() To: Nick Desaulniers Cc: Sedat Dilek , Greg Kroah-Hartman , Naresh Kamboju , Nathan Chancellor , Baokun Li , open list , linux-stable , Hulk Robot , Josef Bacik , Jens Axboe , Sasha Levin , clang-built-linux , lkft-triage@lists.linaro.org, llvm@lists.linux.dev, Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 1:02 PM Nick Desaulniers wrote: > > Ha! I pulled+rebased and this code disappeared...I thought I had > rebased on the wrong branch or committed work to master accidentally. > Patch to stable-only inbound. Side note: for stable, can you look into using _Generic() instead of __builtin_choose_expression() with typeof, or some __builtin_types_compatible_p() magic? Yes, yes, we use __builtin_choose_expression() elsewhere, but we've started using _Generic(), and it's really the more natural model - in addition to being the standard C one. Of course, there may be some reason why _Generic() doesn't work, but it _is_ the natural fit for any "for type X, do Y" kind of thing. No? Linus From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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 7ACCD3FC3 for ; Mon, 13 Sep 2021 20:10:42 +0000 (UTC) Received: by mail-lj1-f179.google.com with SMTP id i28so19423716ljm.7 for ; Mon, 13 Sep 2021 13:10:42 -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=146IDoLHsnlYB84TPDL7kqzW39fi+lkR3958WvJksNU=; b=gyRS8gjhHVDEJW3sWIFVBpPRc2KEVEPHvvR30CLnqsK+D0Cdnc2iMmALs9/mMesYTx DWIkQLMkgDI0IL1b4WvgD65bkxCoJcXYobVOE4MVrZsCt0d4JU3u0ngT8fARn6axUyBf W1N+PxcICKOZsZfThMM7E97Qm8F9LSOpst2ww= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=146IDoLHsnlYB84TPDL7kqzW39fi+lkR3958WvJksNU=; b=6RKDM1Xo9U4iHG/geO2PsTA5e+AjNbGWLZfOMzVPx997L+EpKFkgK/2zWH3FgMPSv0 Ae0H5lTpXH/3rPpPqFX+xdu+WCCaN7hJHwF40dB4VB/K8HSsYOVVOGBTGkMN7svgml+7 jHAjdLr6JNq+ESoG1Q/1vHHN9FLT+07u458ySEeoYQgpSa3lWx7m67eqAcfUJ1v1UH/z NTuU7nU/fXgf4jFqgCW8ZumH+00xp/j1W2u0UBNEuqoXeFK9LygRLrVAV7BIesQWvRGI oE0BXl3oBplKiuIi/R6y7sJdEUJQNwMNFXLPrAd28dX4D41sql820DHber7AR8aBEb+D UPEw== X-Gm-Message-State: AOAM530uCovfaTc/Vui5sHIrjbT/bcYOkdLoZq445JSWqXXCqdBftDSM +OQqB3qR3b5E5kYkok/DZUsrJ45weD7xlkHhwaY= X-Google-Smtp-Source: ABdhPJwgOJrlZQixShdMYr+BRmzxFzUB5L+3bboURvP/+PrkqnaMyDjzwVAhoA4cKOJEotrh3TWHFw== X-Received: by 2002:a05:651c:4c7:: with SMTP id e7mr12651335lji.438.1631563840112; Mon, 13 Sep 2021 13:10:40 -0700 (PDT) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id u28sm918412lfm.162.2021.09.13.13.10.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 13:10:39 -0700 (PDT) Received: by mail-lj1-f182.google.com with SMTP id g14so19424934ljk.5 for ; Mon, 13 Sep 2021 13:10:38 -0700 (PDT) X-Received: by 2002:a2e:1542:: with SMTP id 2mr12239121ljv.249.1631563837811; Mon, 13 Sep 2021 13:10:37 -0700 (PDT) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20210913131113.390368911@linuxfoundation.org> <20210913131114.028340332@linuxfoundation.org> In-Reply-To: From: Linus Torvalds Date: Mon, 13 Sep 2021 13:10:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 5.14 018/334] nbd: add the check to prevent overflow in __nbd_ioctl() To: Nick Desaulniers Cc: Sedat Dilek , Greg Kroah-Hartman , Naresh Kamboju , Nathan Chancellor , Baokun Li , open list , linux-stable , Hulk Robot , Josef Bacik , Jens Axboe , Sasha Levin , clang-built-linux , lkft-triage@lists.linaro.org, llvm@lists.linux.dev, Kees Cook Content-Type: text/plain; charset="UTF-8" On Mon, Sep 13, 2021 at 1:02 PM Nick Desaulniers wrote: > > Ha! I pulled+rebased and this code disappeared...I thought I had > rebased on the wrong branch or committed work to master accidentally. > Patch to stable-only inbound. Side note: for stable, can you look into using _Generic() instead of __builtin_choose_expression() with typeof, or some __builtin_types_compatible_p() magic? Yes, yes, we use __builtin_choose_expression() elsewhere, but we've started using _Generic(), and it's really the more natural model - in addition to being the standard C one. Of course, there may be some reason why _Generic() doesn't work, but it _is_ the natural fit for any "for type X, do Y" kind of thing. No? Linus