Message ID | 20221121024418.1800-1-thunder.leizhen@huawei.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1361668wrr; Sun, 20 Nov 2022 19:00:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf4eNQQnYU8E3zyZ/1lqk5WW9UEYw0QeM7oy2dI8skEgCHpNdwQHB7l3K8RYQNmXwA5XtWKY X-Received: by 2002:a17:90b:710:b0:20a:2547:907 with SMTP id s16-20020a17090b071000b0020a25470907mr24828954pjz.37.1668999648373; Sun, 20 Nov 2022 19:00:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668999648; cv=none; d=google.com; s=arc-20160816; b=TTtqXW07wz2I5x7fv/brIrjIXaOvyZRFOnCZnNJES+J/FRXxAGajKJbV3AyK784O2V VtgauQjgF/+d35nWfLkv0/f7qXXFEZc/ElxNZ0S+tBidF4iIeoGnoz2mh9Z1HgH2tV/v xqOupUWdoE0C1e7Q1JH9FLZleMy/InbxbylELFwrPEPu3jWipVC0/IzySQKIxuKWpugN MN7A4SyxmQVHgjfaeRoH+DDHvJ0DXyeVM2KH+wD30LG0F1/Tcvwf9F+7wIUFCo2Ue7yF yXEFZZx/qrWjuoV0WxFUJ0qCoPcQR+dLnl7EkKtVkNsr1wym5leo3S/Fn92yY3d/kx9K JCmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=idgi3VGebiY1fDa61qr0L1szFkurBlft+fXGLb37Fhg=; b=vT7lOEkmMz+oC9Vqol4ommqy4afZ3Xw/76eN3IpDKsmFGjLLkxqAIdwsIk2Y5t53Bh ESzD7HsiUDwvHnDbzKbs0S7+kn2vNfcK4mlue82K0oPMIPCG+BpHDCUDst2OhHWzxCZc Sr1TiTryV8O+Xa+ZXZsnO9gN87UxX/rJXcF6/8fF1sDPcRy89GSbyHtaAQtXoNb7/82m 1KmRMcKqTfUWRUubUWRt1ugZPxMDMhW/RqCYVK9J+pQwVWQ92crlLHUNHr6f1mu24VAH ikya3A8EGGHYqpctKHEOYY5nQ189t5gvnp0tNS1iYuTrmpX5RAINKeG/8Fv8DZUdaUcO t1Lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a17090341c500b00186b76f4655si5068769ple.358.2022.11.20.19.00.33; Sun, 20 Nov 2022 19:00:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbiKUCop (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Sun, 20 Nov 2022 21:44:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229767AbiKUCoj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 20 Nov 2022 21:44:39 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62D2D20360; Sun, 20 Nov 2022 18:44:38 -0800 (PST) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NFsCt0TydzRpJZ; Mon, 21 Nov 2022 10:44:10 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 10:44:36 +0800 Received: from thunder-town.china.huawei.com (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 10:44:36 +0800 From: Zhen Lei <thunder.leizhen@huawei.com> To: Alexander Viro <viro@zeniv.linux.org.uk>, Eric Biggers <ebiggers@kernel.org>, <linux-fsdevel@vger.kernel.org>, Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>, David Sterba <dsterba@suse.com>, <linux-btrfs@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: Zhen Lei <thunder.leizhen@huawei.com> Subject: [PATCH v2 0/2] fs: clear a UBSAN shift-out-of-bounds warning Date: Mon, 21 Nov 2022 10:44:16 +0800 Message-ID: <20221121024418.1800-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.37.3.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750072975424618879?= X-GMAIL-MSGID: =?utf-8?q?1750072975424618879?= |
Series |
fs: clear a UBSAN shift-out-of-bounds warning
|
|
Message
Zhen Lei
Nov. 21, 2022, 2:44 a.m. UTC
v1 -- > v2: 1. Replace INT_LIMIT(loff_t) with OFFSET_MAX in btrfs. 2. Replace INT_LIMIT() with type_max(). Zhen Lei (2): btrfs: replace INT_LIMIT(loff_t) with OFFSET_MAX fs: clear a UBSAN shift-out-of-bounds warning fs/btrfs/ordered-data.c | 6 +++--- include/linux/fs.h | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-)
Comments
On Mon, Nov 21, 2022 at 10:44:16AM +0800, Zhen Lei wrote: > v1 -- > v2: > 1. Replace INT_LIMIT(loff_t) with OFFSET_MAX in btrfs. > 2. Replace INT_LIMIT() with type_max(). Looks fine, except that I'd rather go for commit message along the lines of "INT_LIMIT tries to do what type_max does, except that type_max doesn't rely upon undefined behaviour; might as well use type_max() instead" If you want to credit UBSAN - sure, no problem, just don't clutter the commit message with that. As it is, it reads as "make $TOOL STFU"...
On 2022/11/25 14:43, Al Viro wrote: > On Mon, Nov 21, 2022 at 10:44:16AM +0800, Zhen Lei wrote: >> v1 -- > v2: >> 1. Replace INT_LIMIT(loff_t) with OFFSET_MAX in btrfs. >> 2. Replace INT_LIMIT() with type_max(). > > Looks fine, except that I'd rather go for commit message > along the lines of "INT_LIMIT tries to do what type_max does, > except that type_max doesn't rely upon undefined behaviour; > might as well use type_max() instead" Very good. Do I send v3, or do you update it? > > If you want to credit UBSAN - sure, no problem, just don't > clutter the commit message with that. As it is, it reads > as "make $TOOL STFU"... Okay, I'll pay attention next time. This USBAN problem is relatively simple and can be located without relying on other information, so I omitted the rest. After changing to your suggested description, it seems that there is no need to mention UBSAN, after all, it is just a false positive and there is no real problem. > > . >