Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp2931366rwe; Sun, 16 Apr 2023 08:12:22 -0700 (PDT) X-Google-Smtp-Source: AKy350ZMZCO3TABwccJZawjJAC/W/J98Ea4bYt39Dfs2/v/P40brDNkdELEFjhP1+Wy6bgPUaLcz X-Received: by 2002:a05:6a00:14c6:b0:63b:88f6:3817 with SMTP id w6-20020a056a0014c600b0063b88f63817mr4010335pfu.19.1681657941999; Sun, 16 Apr 2023 08:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681657941; cv=none; d=google.com; s=arc-20160816; b=uxECn5GASX1fuaHoMF6sKMKRC+XJf2Kutplc7Q3ifKaSDDQ/qXP10Ea0z0mKdpimPc KNtSmcrQkm1QUG6dGdyg7ZgodgINt0HS+P4/+SWe8IcNYae26W1eCaHtfa89Te4XwfTL COm33Em9BHxGUJq/TW7jwOX31dTajxtpkBRn4//AM25Fd6JPjIF7saX+QNolv5zu9Nhz O34hGtTS0AEsAxTkPOj41pCkX+qXcoLcYP/3aebzYIIIrQfyJRZaUJsDWOamJz5RrPeF l1DI/CUoZqK9bgofwy11OHdA1+fdCvkhJ21Ru287gjnq/gNqKTmjJDHGEvo08hboLXRn +XRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=g71EZPjFd9kSBsB4PHZ/0cRNTmlaklQK4MU2WuF1FUM=; b=tsUPzIidxnecm+eQMVtkL3XIRur9s8LNl9Av3vkC3RVr7XSfmM/ttAOuJQ/ngJfQea U/+l5K0QIocF7peFMWObYar70BGl9GNbsqLmvAaD2MoTag1H5Zo+zPAG/hzfU3yuR72/ 1np2czlQDCT+3nuuJ2KnEX7xuijjVLkxebN67vsSI5RtZD8ZthNXrHYB7aq8EaVUWsAT W5klsiyWS48YYn1GcjzmLlZSPgi1W1zd5kh+X495np3r2WgFRkKC8/XkvTmttlz3aSHi UXGOi+UAX4iSiLG3LIke9Mi2At+0lNadP//KtJOE1W4khkZ8Os+boyjJzlXChY2EyoQg ZM6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iIQnBNiO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a621d02000000b0063788e7589dsi7410974pfd.95.2023.04.16.08.12.11; Sun, 16 Apr 2023 08:12:21 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iIQnBNiO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229588AbjDPOrG (ORCPT + 99 others); Sun, 16 Apr 2023 10:47:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjDPOrF (ORCPT ); Sun, 16 Apr 2023 10:47:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B72B31AD for ; Sun, 16 Apr 2023 07:47:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 50B44613EA for ; Sun, 16 Apr 2023 14:47:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3863AC433D2; Sun, 16 Apr 2023 14:47:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681656423; bh=x/zF9nQGcQmo9J0zDMKFR6/60lK6sJYHHMJyzn5OqyA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=iIQnBNiOrw67ku333VmuCHTxqwb3OmXUK8Tk+5/KZ2gLTOY0bfRi3eDvWFA/pIGeA NmFzgRsURvpnN4rqgwJVnNKUXjB8FlULg+y+5nr1n5H0dI6ilHOu+AztB4wtCkiofi 4n55gx+KIoztTEnVrxCkB9wCENvp83H8+EJVuPu0TzipeY6H79cVcg2EeEDc9omcjm ZG2nBD1kxyqYii1JrvTwIsAah1hhvhakzn/9PrLAyE1i3QbCwaSSzn1bEYGYy/Bzs/ qwNOgHCzJMQlssacdK2HPRhDHMMloZsLhRknSUtJxvGNzVTUARTfyyvvGoQ4y9YEi4 vV5Z1QGdyWbvg== Message-ID: <363cf8e8-326b-6547-b780-268ce2e3c1a5@kernel.org> Date: Sun, 16 Apr 2023 22:47:00 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] erofs: fix potential overflow calculating xattr_isize Content-Language: en-US To: Jingbo Xu , xiang@kernel.org, huyue2@coolpad.com, linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org References: <20230414061810.6479-1-jefflexu@linux.alibaba.com> From: Chao Yu In-Reply-To: <20230414061810.6479-1-jefflexu@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/4/14 14:18, Jingbo Xu wrote: > Given on-disk i_xattr_icount is 16 bits and xattr_isize is calculated > from i_xattr_icount multiplying 4, xattr_isize has a theoretical maximum > of 256K (64K * 4). > > Thus declare xattr_isize as unsigned int to avoid the potential overflow. > > Fixes: bfb8674dc044 ("staging: erofs: add erofs in-memory stuffs") > Signed-off-by: Jingbo Xu Good catch! Reviewed-by: Chao Yu Thanks,