Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp240562pxb; Mon, 13 Sep 2021 18:05:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV2hJkRT1mrs/bgwTq4MpwbNsEBv1HRiZSQo9w9Md8E7lfgVHCmaVNt09xowu/xj3HUXmR X-Received: by 2002:a05:6e02:6c4:: with SMTP id p4mr4529559ils.182.1631581520729; Mon, 13 Sep 2021 18:05:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631581520; cv=none; d=google.com; s=arc-20160816; b=rTwvdFCKd4nWjRN2Cdimag1HT774GbTQ+y6lTO+nffMpOEcPyxpuGBNDrE64xSQ99X WDMk7k41WfFNv12YhTHCseGVfevcGrJl9arM6dqCMlL/lqO4V4mrQtJIcn+uQ1eIBgdo v/aQyeqa3iwpfh6/5RkPVwkOfiU7MJbVaxvXY1QZUcBgn+GDTpeHUFcLRsw+KRPQ2E4e ehoCQVhJAlVfENGpMtl/wg34vk0IPD77CX9q0cbFvTSoRcUYuY9+Pl6CtvycOgsoZWUH rGhb0D9FErAwJ/CLTQkvUPak5uwFlPwja8PEYkPv59ochTEVps+HSIjfC2PFrL8eEMk7 GoKg== 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=E9BTZz7P4136Vx17+j4gvrYMgr1v/N8zIGjbUFEwypk=; b=v7mwf8yY1DqqSKgw2tO9uHr3/iNDi1lByazUoCQFUx2FNIGIssIfd4eyEPFbtNANoR ByyWkotb42Z0fz8Y25NXE8dyuGzV87N8rQ8rhEE8Js2QBqFn7CpFOg2U0MSTVMNEbsrP t7oPcoN1dgyi7NgQmHmmKVFUaAZb3K1KKtrIDsQ+iqazC5wyt1PyxdABDB9rjtS1Anbj Nx6Rf1vBbY1gs9kGUJHNcZImsSk5IZZEvMAd9/eDsdOiuXpbQwTtNM5s4OXF7fQjQaIA hzny8JfDx2EY9Dt3WhZXQDGiUEm1KcZP6R0hDzXWcTvYbKTovkYSmVzGjrWruCkAQcQM 4W/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=pGWIil2q; 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.05.10; Mon, 13 Sep 2021 18:05:20 -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=pGWIil2q; 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 S240553AbhIMURv (ORCPT + 99 others); Mon, 13 Sep 2021 16:17:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240606AbhIMURu (ORCPT ); Mon, 13 Sep 2021 16:17:50 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 013DDC061760 for ; Mon, 13 Sep 2021 13:16:34 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id w4so19424582ljh.13 for ; Mon, 13 Sep 2021 13:16:33 -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:to :cc; bh=E9BTZz7P4136Vx17+j4gvrYMgr1v/N8zIGjbUFEwypk=; b=pGWIil2q/K8JwjJfMEfl6tF1g4EZC68ukMYbPMY9ZEi/H4fw12ekTh5g5zL8JoOfiA Itg7hB6e6NdOVVs+dDnBzvn4o8dMKsckPAz/60KVdfGqmyoJ6QK8O8XSMvy02fnPUUi2 tsqShyEUivl97LS4GtdmCzPBQvRoxEzITeFeGmQ07b7Myd1YXOWHnqGKSRpzQDXfoH5m LLj38yKo45ErdqEUPpgk0TQF92aWtsPcpLfPj2OV0Nnhf0o3TeKcPyFt1sGjjSy6KFeb kU12tBInuUNGU8jbKIRPJeIPDrk8HkuQK3GBrf+7mC354xOIiieTE6E/g36NpPpze6sn +weQ== 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=E9BTZz7P4136Vx17+j4gvrYMgr1v/N8zIGjbUFEwypk=; b=yoLhV0wd8qYLYvB4uAYSpB2fmH2UegRdZdhHgTxgw78Q6B7WR/ujEtI0zX57VGSRxT wWiBD9BjFTqR9LC6EAU6oi+DB7WTY6ZuJcBro6xgxkCwrIlWo9l0Y2h2PK1FE4fvn+O3 xAwfccmKjB+zCFwA5lFZ016v5oGrpMPFMBY18Oc+IS27JzlhjXmqnQrcVQQPV2TzLEhc 1/Bky0Q7rRqO3EnD+AUo9UEr4c17gGXAD1C4hcbnb7wZiUPpxNZGnLdox7VpApAby3vK Z2cHU5HkLxycfdp+vw2UNydtMrtoOV8KKo1S1z/7k3MA9zYgQzW7hXTSWCeQdusUlgof VCig== X-Gm-Message-State: AOAM530D7CTUmnjM2E2xn9G+9XSw5NhohDFZFW7cY5CQrIQ9uGfHP0pS hdF5ns5kVdHac/aksgJqkm4eH/sALyGZOLqcHATFeg== X-Received: by 2002:a2e:4e09:: with SMTP id c9mr11984681ljb.62.1631564192079; Mon, 13 Sep 2021 13:16:32 -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:16:21 -0700 Message-ID: Subject: Re: [PATCH 5.14 018/334] nbd: add the check to prevent overflow in __nbd_ioctl() To: Linus Torvalds , Arnd Bergmann 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: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? -- Thanks, ~Nick Desaulniers