Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp233749pxb; Mon, 13 Sep 2021 17:54:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEPlhymzyyJCYUisre0LcodMPsAuNAgcW1OpJtgS0WPlKrkUVmqzzchRWqj+iw6gOyzKxS X-Received: by 2002:a17:906:31cf:: with SMTP id f15mr15804571ejf.272.1631580880373; Mon, 13 Sep 2021 17:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631580880; cv=none; d=google.com; s=arc-20160816; b=KCUdHwJ4PgRV3dLmhtBeWALUC8KfdrZQ7BclSwWiAESGH8ccphbPfTt9/sloiJnclx OSXLrPPZHHNiQrLqHYft237pltOINIepmvJ5XLKJ5HB9WAJc1mzonhod2Gke+iXMt3gf Tc9llcqO4dKNv1lo6oUDWjl29t9NwWrxt5Dik/zcSxSq/tkQgUjMIt0Q0Q9aA/beW9y8 oAuU9seiFwUpRIYD/AUnLvjIIKcGrh2+TAYZeJZzuSOzw0UQRBqZrG8fp9wzCPSf3Qtm rGZMV3fT8A8Mjo28MMbr/fi2lzGQFH580c5uS7GZsrt8C7aUJdpVeMThYfkL1WnA3pec IgLw== 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=Gsr5LZp4mspjysvxu5nUdPKorXySGG+JMQ2KUyjakOE=; b=WpoVkdsqQTqmQll3sWxL/MeMk+NEo2Dphkw3dxDxoIzJ75OHEPWPdd0VcKSPc8sT97 7YGStSjavtqzoLlo86uUxjioUZk/6If3AvraasblHpIhHVuUyw3LaNfZvC94tNuCljks BHPg1G2uuzhursnjZ/BNrkaU98LIB/nd5MXDF7ok1ajc56BG/NhsDBWRR0Smc7UOpReC LDAgnB0aBuWJkaySHfUSCqvDJvUtrXuk9qHtUwyFgKP8PQl85QPOvDQaIkE/u5OzTIDE fdQhMcW5iZRd8yP2RRFtU90hI2gUnhUe7aOY7wa31jilV4TRlx8N8W33bsOUuxUw7YK4 Jeyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=tcNOwy+h; 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 t10si1895042edf.614.2021.09.13.17.54.16; Mon, 13 Sep 2021 17:54:40 -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=tcNOwy+h; 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 S235873AbhIMSkx (ORCPT + 99 others); Mon, 13 Sep 2021 14:40:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbhIMSkv (ORCPT ); Mon, 13 Sep 2021 14:40:51 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9F48C061760 for ; Mon, 13 Sep 2021 11:39:35 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id s3so18984284ljp.11 for ; Mon, 13 Sep 2021 11:39:35 -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=Gsr5LZp4mspjysvxu5nUdPKorXySGG+JMQ2KUyjakOE=; b=tcNOwy+hx3G7tDym26NrZiXL2XWVfVOinWzaPRaxtSumdMCEMHyQMS5xN+W+Z2a3Pp Yyjh/Aquz4bS5k72F8kzeTZLT6pSCAwxItpi90F1EBgGsfx0a7X5GHKo9kEfQnIw/K5o 7FmsF1N2fJOdGgHBXU9jSs6LZXwz6kp3GvpswTBmJ4XVr+8MLfvY2DnXC45Tf+PJiita sPgwimOij4te8yuQYluDFNeehCU/E13bJ7Z26XkxG5BIjzjHtbrIcJtf/SECJRqEzJoS lGMzeeTXj49IrKVF2TkOEbCd9wb8x356nbZqWE8MShw7jmb6O6C2PkQEEgNqFbtUqPLA Zngg== 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=Gsr5LZp4mspjysvxu5nUdPKorXySGG+JMQ2KUyjakOE=; b=rOFHRknDGUL5c+VsxPNezAkhQsIb/oTI52WD5RrCVp14Tazh8WQ9uyBB2j2PRVra9w gRhtsRQFd9RtEGxMoNg6jCQHXYxVaXdV3l6Bu/EosHPfkJ0kLyubCRTt/Vd9bKIQFSGS HPb/jDo7o4NvPWnscPozPXFLLBR4/zBxIpYxjpjgAu0UxE3E4mCAgNx44wP0JS+tAGEi 5JZXg6JQcfYwaddxghUlmdue/pUzWVJ6mL7UEbCDT6TOJS2hbUioX2Mq+dh2E9+dRLOh 05GDLvDlKoZaA6QCqgJUOLAS3uonJ9iYWvTap/5ymUD3KGxERYbMwjpKHSc9sm+qsiXd Zdow== X-Gm-Message-State: AOAM532xbCdqzPZvoC34kkgyz7QKBQOKiCPO0lGeNFsFU0cuqm15EVIS AsFQf1kFVMknClYn6robg7VmLM6x7BjlFuPex6QJpg== X-Received: by 2002:a2e:8808:: with SMTP id x8mr12089846ljh.220.1631558373845; Mon, 13 Sep 2021 11:39:33 -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 11:39:22 -0700 Message-ID: Subject: Re: [PATCH 5.14 018/334] nbd: add the check to prevent overflow in __nbd_ioctl() To: Greg Kroah-Hartman Cc: 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 10:58 AM Greg Kroah-Hartman wrote: > > On Mon, Sep 13, 2021 at 09:52:33PM +0530, Naresh Kamboju wrote: > > [PATCH 00/10] raise minimum GCC version to 5.1 > > https://lore.kernel.org/lkml/20210910234047.1019925-1-ndesaulniers@google.com/ > > Has anyone submitted a fix for this upstream yet? I can't seem to find > one :( That lore link has a series to address this, though that's maybe something we don't want to backport to stable. I thought about this all weekend; I think I might be able to work around the one concern I had with my other approach, using __builtin_choose_expr(). 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. I need to play with that idea more; maybe that could be a more manageable patch for stable. But I also need to eat lunch, and I've been in the Rust for Linux conference, and trying to organize 3 other conferences for the next two weeks... -- Thanks, ~Nick Desaulniers