From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 464A4C433EF for ; Mon, 13 Sep 2021 18:39:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 285046108B for ; Mon, 13 Sep 2021 18:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239731AbhIMSkx (ORCPT ); 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-Google-Smtp-Source: ABdhPJxr4FCmAlu5SlbIY3KpCOou2NcGaA/MSwV9TxbMuHHx3SyU4FoEmbG/iNG0U1htM5yQCZ0AvH3kwb0F3zNiDOw= 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