Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7575091rwb; Tue, 6 Dec 2022 07:24:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf5W2E2TrwutJDhE4k4fTvFc6QRoDu+DGS2ekM+dpZ1Oji3hOLZ4rxgnlMubNmW1njkEwLHi X-Received: by 2002:a05:6a00:3385:b0:56c:309:b900 with SMTP id cm5-20020a056a00338500b0056c0309b900mr68804027pfb.21.1670340271872; Tue, 06 Dec 2022 07:24:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670340271; cv=none; d=google.com; s=arc-20160816; b=SPGefFoSfC65QXv9htU1vfzLDXLxwOca2T2fWtCOco+fnKU0nr/nKtytOIP6H/7RRq +ub5FsMF68D/uRm8MMyuzBpTNhmerbo8pUujHUI+TdjLX4EkoWcJbCBuoJa9yk8kD8OZ RSh5qjMow4h7Tfy8FiaUWyKDHjF+PuwsijZwAjX8G4QhRGcSKwy10rLGQ7j9hFpSBuFS rM09NWov8sdQplI7JTl6Vg6172M/pX4C0HrZG34fG7hFYwyNZfAK8hMWZaaawW3s90gz RDHpG2hOHwGeFvRQ5Ia0YjCFT9hkYRSH/3+kEVKZtmhtvQvG9WehYU3xbXHWHgfO9VkY Ra1A== 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=8LIYrIK/fSN7stmAQgTqwp0RSvDKTKQMq30AgAe8hmc=; b=Ks13YTXJLpDVo8Ig/0pCNVqLAHP7QcivMnvV+KGQW8hShay4BMFJu0UGuq/P9Rr+kq /qcXuzqZVgM0sAEEMvBkI+uswNA2h8JvB9t93pavZTpiC6qQ8QL0l34Di3z/C1Xi7ZcP /iuqEqpcMIJfnEEl5yYtkdRBVU8HrL1jaK/4HTvuJefFV3sc34lS3/0eWMPz9R58+rEv 0wPYLylGiSAND83B3jNmGXDOy7aQlaQnVhDCCS/n2f2J1yJTobVKEh5y0yu9jQJA3H7S 9f5uoSt/P/MxLVh4lNuEhALXuIrhO5bGC0XztBGoEcAkLKQi0eP4iplKazPqbuMIlA8j oDKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dOw7DB1r; 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 o5-20020a17090ac70500b0021a01dc8e4csi1471522pjt.143.2022.12.06.07.24.20; Tue, 06 Dec 2022 07:24:31 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dOw7DB1r; 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 S234663AbiLFPOK (ORCPT + 79 others); Tue, 6 Dec 2022 10:14:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234648AbiLFPNm (ORCPT ); Tue, 6 Dec 2022 10:13:42 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFF602F3B1 for ; Tue, 6 Dec 2022 07:09:58 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id BE090B81A19 for ; Tue, 6 Dec 2022 15:09:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1741CC433C1; Tue, 6 Dec 2022 15:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670339358; bh=+JcHD2fgJ20Y5Ga8vP9xc8ZWJSsLdzLTyYcLglXSHoo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dOw7DB1rthod/ATG10j7eSN1i1cwE4kYqTn501nuEHEErFUTP/4wH/NNQZRONz+ov q+f1d9dDjIzLec3ukh0piDqRovFVZLIvfwTfBI7G1/id5BOBqxlO631NACMvEr7VJm Ewz744z33wjCJGRW+1Qe9WDQQw9S/CuPXYysYLZ5VXNHsGPM3CY53KIJw16neNGxna b9jHqhRI08YNB3FukZeYU9u7TX8bfiG/J8z2VPzlaUf2W/QytC6icBlRsKWUooP6Nc KtqBLU7iXbBGGnCGyfGdorFJJ8G9fU/xo8anxiGtetDbSoJY3JsaPfRx8vBPkeOynn jxMj4adJb2cHA== Message-ID: <3f0b9ff1-eea5-150c-c57e-4e1d0a06e220@kernel.org> Date: Tue, 6 Dec 2022 23:09:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH 2/2] erofs: validate the extent length for uncompressed pclusters Content-Language: en-US To: Gao Xiang , linux-erofs@lists.ozlabs.org Cc: LKML , syzbot+2ae90e873e97f1faf6f2@syzkaller.appspotmail.com References: <20221205150050.47784-1-hsiangkao@linux.alibaba.com> <20221205150050.47784-2-hsiangkao@linux.alibaba.com> From: Chao Yu In-Reply-To: <20221205150050.47784-2-hsiangkao@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 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 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 2022/12/5 23:00, Gao Xiang wrote: > syzkaller reported a KASAN use-after-free: > https://syzkaller.appspot.com/bug?extid=2ae90e873e97f1faf6f2 > > The referenced fuzzed image actually has two issues: > - m_pa == 0 as a non-inlined pcluster; > - The logical length is longer than its physical length. > > The first issue has already been addressed. This patch addresses > the second issue by checking the extent length validity. > > Reported-by: syzbot+2ae90e873e97f1faf6f2@syzkaller.appspotmail.com > Fixes: 02827e1796b3 ("staging: erofs: add erofs_map_blocks_iter") > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,