Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp238663pxb; Mon, 13 Sep 2021 18:02:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLKd0wJf1o7m/UXAzpJB4FX7Z4Xt5u72vqIig7DYkly4F5QE4HOjr1Bzr3w5e330mbGEXV X-Received: by 2002:a92:d646:: with SMTP id x6mr10144233ilp.280.1631581337010; Mon, 13 Sep 2021 18:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631581337; cv=none; d=google.com; s=arc-20160816; b=Bam42vj5SVrZmlu8hXmdKyiIg7Fxu3W51gXp5uuqoX/0KTKeT8jCpvVZcdJHoGmArx sL/53LEpkT51qy22klfftOJkoOtE/RYb1YN/6XW5juSvgFqOR2JJdDhpzjTvM5aMMJcE X06Jpuyjv3s0ZqGPOqsI/cNq5IM8kdMckLGrMGclF9PHU9z9Xi/v7cA9lfV2l650HBt5 yF1LgFVxCCzqdECOhPf3Ve3zLwvAiRI37QRJ0Pdsaeg1MJyN379Y8NS2Ma4hV984Rzwu 6dU49Rwk1O4R13plLU4B1kbwMdkHi3xQp9VqOrzzuJt/w/EiDC+L4EDe3ayq/glUsv+3 h4ng== 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=gVlem88uR6+O3AEpNn6Yh2wjkDnIsvdG9SBuzHecDPY=; b=1BCLh6BdjjSHO8L4hTHytp8v9HK9pIzDFhtF5VohTt6gLzAi5OUv4ZxtrWutAHRl+1 ouasvHwK+HC25IDWLLuoxuNU3jghshmXxE9G+yLfHAbd8MMvzrXSxRUnk29IvDFqNorw JKjD9pHqKjyRZTNVD9plx1nWPUmaJk173yo4im4vt2Cg3EX7cr6N2ZDS5VJ8D1++H/xi 7fcpMIdjxg4kuRyELnMpitklKmbQ6kQRrfxiBfIa9JZf0qiKwPHz9vYRUnOjj999pXs8 FcPSdspSeeKYNIml6rpbqYoO6gHfhtX3bRd7lK2AviC+WZLDmbIxd4RHKLM4O1W5VRha SXrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=UtwnzoxI; 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 a3si8012324ioc.79.2021.09.13.18.02.05; Mon, 13 Sep 2021 18:02:16 -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=UtwnzoxI; 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 S1347771AbhIMUEC (ORCPT + 99 others); Mon, 13 Sep 2021 16:04:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347763AbhIMUEB (ORCPT ); Mon, 13 Sep 2021 16:04:01 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE8DBC061574 for ; Mon, 13 Sep 2021 13:02:44 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id s10so23528323lfr.11 for ; Mon, 13 Sep 2021 13:02:44 -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=gVlem88uR6+O3AEpNn6Yh2wjkDnIsvdG9SBuzHecDPY=; b=UtwnzoxIKMk4tOfMxxm4CpllD0ShmrKrKQSd8xl/r5+Nf6ZLZtS9/OyvibeXeJRjJm qJb8asXWsxkH8rMGhQmFiAc9zt9A20ouuq77sfZCOcwEBRY3tnwTv8gByYQCor/Quz48 og1G2y8Pl9wxe7Gr4qj+V+3W1nEqAaqVtcdiHmee1cHKUsJcv7M1ZOYmo851M7WyJjxB s2cwUJHvcdnzka3/e/fwcF8RA8HvXllV2N/rj5OSMWm+RkgRLLf9Vx78zmfKw/WSWc7j E1acsbtB9KLKrBrScCWd2Unh4K44M/5o+4GJsvBA1ZhCB35t9GyhLHgeM4zk+YAM2EGy Bj6A== 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=gVlem88uR6+O3AEpNn6Yh2wjkDnIsvdG9SBuzHecDPY=; b=ohv+Lbf26h88n1ZoDkngL15xjGVMC9rn8IPtswrnvXYgzw+vCiqzGIwj2DBr+PGWIr mnY5Al7kw3T83WJKsTGlSg9oSd6uc6/etrt5dUYyAefa6phyRL6gcBUcR1qkv1pTNTuu umBYEXShdzpYYNSLVsFhgZy03WTK3EY20AgiV2vS8R6c2LZmRFh1aMeFTpvAQF5P6lI3 GPdsIlMEuszFQXjZjsRR9K28VWHRBW1KwLbyB8Nr62J+NVehEL59aFbUSQ3inUJF7T5j JymBHVRlsZhvDnFnhuqALrh/0QrQFmcI7QXVKY0VE4/ijajB7gTPLzo5/WbrEwgCRyQt dWvA== X-Gm-Message-State: AOAM531QfotECHV1HDsererxjN6d/q4nlTsdEdoV/JR8Qe5e0BWhJ6W7 4wvnoz39s1G8wXnDBGH+73wGmDQQyg/bPKtlgpq2RQ== X-Received: by 2002:a05:6512:139c:: with SMTP id p28mr9744729lfa.523.1631563363038; Mon, 13 Sep 2021 13:02:43 -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:02:32 -0700 Message-ID: Subject: Re: [PATCH 5.14 018/334] nbd: add the check to prevent overflow in __nbd_ioctl() To: sedat.dilek@gmail.com Cc: Greg Kroah-Hartman , Linus Torvalds , 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 12:57 PM Sedat Dilek wrote: > > On Mon, Sep 13, 2021 at 9:53 PM 'Nick Desaulniers' via Clang Built > Linux wrote: > > > > On Mon, Sep 13, 2021 at 11:39 AM Nick Desaulniers > > wrote: > > > > > > There's an issue with my alternative approach > > > (https://gist.github.com/nickdesaulniers/2479818f4983bbf2d688cebbab435863) > > > with declaring the local variable z in div_64() since either operand > > > could be 64b, which result in an unwanted truncation if the dividend > > > is 32b (or less, and divisor is 64b). I think (what I realized this > > > weekend) is that we might be able to replace the `if` with > > > `__builtin_choose_expr`, then have that whole expression be the final > > > statement and thus the "return value" of the statement expression. > > > > Christ...that...works? Though, did Linus just merge my patches for gcc 5.1? > > > > "Merge branch 'gcc-min-version-5.1' (make gcc-5.1 the minimum version)" 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. -- Thanks, ~Nick Desaulniers