Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp241369pxb; Mon, 13 Sep 2021 18:06:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/s3JZ0WLZWKeoCvm5uwO+ayuyUCJv9aLUKaUi7hh9WPsjaYf/2T2dO8kcxXF3me0BRPRP X-Received: by 2002:a02:3b15:: with SMTP id c21mr12463535jaa.54.1631581593997; Mon, 13 Sep 2021 18:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631581593; cv=none; d=google.com; s=arc-20160816; b=bGtRjdnAZKB6nNjGIAH4TfW/sCGps/ArdBKpwbSXIlJpQV4x6LTnSDo5195CNl9Ia9 FE3OA8E4/B+Unjw9FD/12OMUJEl7UZJ2r6pV73cyRGhdxo0K0SpQe+gV1kal92wWt3Vo KFgg1Elak+F0FehTlDsKOT9u5KR47KzfmX8JeQVVSbbXENoWVHJVkT4JgXiPnUW1qUYR H6itqb231hj3fxNIjawZm9asRyX3oSbG4J/0sTq9DhudcGxF+32tSg8M8wV8A767hjJt vjt78It9+rd6G0Z0I7wxGuH8rVdqul1zZM6LFbg+xDqWDqr11yKvyWjfUtkG4qgGe5vX fspQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:cc:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uNcqj9xjWIfQIY0QflXDG20YjitmguOx4ywcCWl73/U=; b=wkv1FGOUHRYQYtjnHwqOQzYvcTt7+N75d9SaqYpMUmQvArDWNFz17Sx7a5lCRDG1ok yW5LFe0KM9VcGjGQo/qH0vlzVMDar4Y4LUy0zaQhJTM+mJhNF2G/KsOTfX8wxRju2zes yWduDpCBS4wn5rXoBEgLmpOsULkKKbxBPPDkHYmMFkKX7EmDqGWGr6CZ4Hak7x7yEcR9 wvGRTt0HPtgyq5jvSEDT1NMB8FLuH3ZF4KbIdIJM4h1wZrHKfaWKCEQhMs5C4eRPpbQd IMHQerS/MQzmgg9Rvt6zVvJWIckYX+1Nqi/dd1e4stH8r5lauyvYDOCIjENRVLbW10mP KFpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ilWLGdi3; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n38si8303128jaf.72.2021.09.13.18.06.23; Mon, 13 Sep 2021 18:06:33 -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=@google.com header.s=20210112 header.b=ilWLGdi3; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244563AbhIMUiU (ORCPT + 99 others); Mon, 13 Sep 2021 16:38:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244538AbhIMUiS (ORCPT ); Mon, 13 Sep 2021 16:38:18 -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 E1B85C061764 for ; Mon, 13 Sep 2021 13:37:01 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id k13so23725954lfv.2 for ; Mon, 13 Sep 2021 13:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:cc; bh=uNcqj9xjWIfQIY0QflXDG20YjitmguOx4ywcCWl73/U=; b=ilWLGdi3Cf8peiOJcbZixLNgXePN5jQ7FtqkR0ne0wGyCRK96xVTx6VujOtvGJnwOA t29LDmRG+oQphsKQLnpgKx0qT0UFM0awAHItWH/qAMoFwuMy1QfcQ+Htb6PtxMKA0yfi FfYper/cc47ppbEIm94dxrSsOZzWauuRFeUEGD1On65oseTwVG4b7swRd5bBE7KJ9ugH muU1CEublYt5PHRS7COzLUHbPECVYPxwPrD9v0OcSC5aw/MKDfgo+UWjHNk1XfiEJZSA QEUvgjOv/V+CZ1qNhRAAq28FWdx6nR1p3+erxw08PjXPab3mgwlZu/7cKFrCj+ejmrOK 9Pmg== 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:cc; bh=uNcqj9xjWIfQIY0QflXDG20YjitmguOx4ywcCWl73/U=; b=I/NTKbvMebsWWDxS5ht+PAuztLIZ0R98bNCGUdfkVBFuUTxyfZL4GHVVikguEGlbis QA0dvgVHUxE1O5srtLsKIThLMWP3lzZwjzf8/XRJqAQGo82bRI1206oFSO/eMRGg0Blr eF5Fz3TwfbOCU0c5XxzOTTJ/xiT2RikC2QXCpl4phpYqewOoWpPPCWg3JBeBd0hskDLU oDylug7tEDrLC2ieCVBB8N/opgywjfSFQl9aoyjbRZP7KwoOyloX4s4u5sLED4NCAcef tjkwF47bvGMATWy2rGx/ItD3YMBAnco6aW9udhtM0Sm7ePXD20m7LCeTTNapJV4iOWeU ZWYA== X-Gm-Message-State: AOAM533FBhbSAIPVeo231vgrooH5MK41uaV6PoAd44dse/tBlGqlclId wVyxhSKyyfSKqray3JJfGPwP5BQIRP710tnRjAOq+g== X-Received: by 2002:a05:6512:1114:: with SMTP id l20mt4770203lfg.550.1631565420008; Mon, 13 Sep 2021 13:37:00 -0700 (PDT) MIME-Version: 1.0 References: <20210913131113.390368911@linuxfoundation.org> <20210913131114.028340332@linuxfoundation.org> In-Reply-To: From: Nick Desaulniers Date: Mon, 13 Sep 2021 13:36:49 -0700 Message-ID: Subject: Re: [PATCH 5.14 018/334] nbd: add the check to prevent overflow in __nbd_ioctl() 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 , Linus Torvalds , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 1:16 PM Nick Desaulniers wrote: > > On Mon, Sep 13, 2021 at 1:10 PM Linus Torvalds > wrote: > > > > 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? > > Man, c'mon, I just got the __builtin_choose_expression() working! It's > not...too bad...ish. (Besides, I'd actually have to learn how to use > _Generic...I've never quite gotten anything I've written trying to use > it to actually compile). > > Do we have access to _Generic in GCC 4.9? Follow up thread, sorry/not sorry for not taking the full cc list: https://lore.kernel.org/stable/20210913203201.1844253-1-ndesaulniers@google.com/ -- Thanks, ~Nick Desaulniers