Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp266306pxb; Mon, 13 Sep 2021 18:51:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzp/l1+5kOp1XIB4rSWCiQ0fVsMzm21PFfFKMsKmkr9wd2VFAUZjVRe1VHOvf70cY0w1vOk X-Received: by 2002:a05:6402:452:: with SMTP id p18mr16845799edw.34.1631584306836; Mon, 13 Sep 2021 18:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631584306; cv=none; d=google.com; s=arc-20160816; b=rGP6CgX8Wu6kSdKt0xs/J3yBCBTFaInMy4xlFXA0qI3eWCkuNVJqVHUY4WrwWNNNkj SBrFmkluxeKjiP0/qqTkqsqUgEFBt7VF/CWO9A5PMtMAmCujPfmn2QvlQfygYnrMzk2f vp+cXWmuojGdgytybETxyRBqyeh1CyM4cUA/JOur1pHkqOJxDxB+YBTZTI85D9QOLJ5K rN+kyxhxBNx/e/AF/vleawQ5dOOl5Db3JFX5+oCNFx2TKMOSnsP7w7eLKDsAt2pcpP2n p1P56EwG1QGttZ5hVsPeFeRyagfjHQbDUAXlWJXIiWHd4ftjY+hWLyb9XTV8SM62Xj7d NtzA== 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=Bq011lt5dgdAQr/ZuHdy0F7gQGrCf2JBCgapEFXHuqM=; b=oEKhk9rQAOlDv+yZgZEVhST4I+WUhrtpgD+tSSPxjnRBUuqJZgCBfT7AJOlR0wRzf+ z5GPdDQWLJJYGC9mASAfnzKVvwk2D+5JhEo2it/dAKBGzmu1vnmXsykNA6lARMv9n2Yu FO3+CN2+H0w/0tLOpEhsR7WXt7c6tXxpmI9wfyt/SuK7pajO2tpcmKVUDfTRTBzTC+z0 B0wHbdJdpw/z5kJTTvLSM/yhRB/co2B+wVjNivGoJVp/J9p+XOR/gFi6/B9powbXw/II opyxrBcXnGyqG685aOZ7SOcw+j++2yWYx/NAogmPeH1mtDP0ZpE4k0PoP31uSdh/X+Q6 NSOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=B5LAKq0e; 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 h8si9432980ejj.422.2021.09.13.18.51.23; Mon, 13 Sep 2021 18:51:46 -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=B5LAKq0e; 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 S241475AbhIMXZJ (ORCPT + 99 others); Mon, 13 Sep 2021 19:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240144AbhIMXZI (ORCPT ); Mon, 13 Sep 2021 19:25:08 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFA46C061760 for ; Mon, 13 Sep 2021 16:23:51 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id a4so24513459lfg.8 for ; Mon, 13 Sep 2021 16:23:51 -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=Bq011lt5dgdAQr/ZuHdy0F7gQGrCf2JBCgapEFXHuqM=; b=B5LAKq0e9Lnd5npvhdHcFrbSooQRxBJX1Mid0sG0F3Y8SpqoLVt1M/6eaaJxNPhc6n INFlj/Tt1MoyRllidkDtLVM+x6eN87fZX6VP5txNWI92MLfBYCgGHOf3RwiK7p0Kx4Ag 82m683k6K6uDE2tGwFS+1G0xYpeTnVV6tnskfN1LZcU4NLKxpmgMLVzbhJ1gET8kLl+a OecFijs+X1BqnYIeWbaSM059NUhSXkWGEmuCHcOTdTBXQyrqcbV27hzBFV3toN+J7u3h Lj1bSuh+muSl1kUSArFWPu9/nKBp518gZrtFshFffdP3E/AtaEduBFN6MqOcpxzu2YAJ kghA== 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=Bq011lt5dgdAQr/ZuHdy0F7gQGrCf2JBCgapEFXHuqM=; b=A01kzsI6Hc6IJ9SwyNeeEePs+SFQnI5dyUm+w8EL2UHpXjj8rvRKFZuRd/RS2Epm7a 6uIEk+JQLI4zY8+EXW3i/TOgPt43FWd/vPdmYYWovyNEEeFM+xRhlQhOWoORSrlW48dd c+/8oA73KNdEb0o9khIWVV0bq99ou3qmP2qauyhQ0lwz7EW6LVm5OGoeaURbFnwSVVKi DrqrFhRkVQyHQT5zFohsq3JjvrcA7cxbxkcn52AdCG2tbbNVR/kLhO0kKbOv3XorrvoM ch2ePo1rxW7CvftViz7y1l/fLXsHkUKyZyeT/12uieicTADHvS3UMn1yFRN1ubMnS6Cc sXqQ== X-Gm-Message-State: AOAM533rsrNKom1Le7xVXYZNsmh4l0fvHiF+qSuYj5PI4eZz8jbHhu80 1xZGjA9eR1qVDeUIikexU/skRXA3lH178qDrUTBb6Q== X-Received: by 2002:a05:6512:1114:: with SMTP id l20mr11222779lfg.550.1631575429882; Mon, 13 Sep 2021 16:23:49 -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 16:23:38 -0700 Message-ID: Subject: Re: [PATCH 5.14 018/334] nbd: add the check to prevent overflow in __nbd_ioctl() To: Linus Torvalds Cc: Arnd Bergmann , 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 4:00 PM Linus Torvalds wrote: > > On Mon, Sep 13, 2021 at 2:15 PM Nick Desaulniers > wrote: > > > > Sorry wrong diff: > > Well, this second diff was seriously whitespace-damaged and hard to > read, but while it seems to be the same number of lines, it sure looks > a lot more readable in this format. > > Except I think that > > default: dividend / divisor); > > should really have parentheses around both of those macro arguments. > > That's a preexisting problem, but it should be fixed while at it. Ok, I'll send a revised v2 based on _Generic; Rasmus can help review when he's awake. > I'm also not sure why that (again, preexisting) BUILD_BUG_ON_MSG() > only checks the size of the dividend, not the divisor. Very strange. > But probably not worth worrying about. I sent a not-yet-applied diff of my not-yet-applied diff. I was playing with this last week, and IIRC we had divisors that were less than 32b being promoted to int. But I'll test it some more. -- Thanks, ~Nick Desaulniers