Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3706878rdb; Wed, 27 Dec 2023 18:00:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3rylp+8luGsNljDJyntzP4ng56SCMDKPuNAIypjy8TqYTJNxIfXHCk5KzKuD7Jgd9KS69 X-Received: by 2002:a05:6e02:348a:b0:35f:b462:dd6a with SMTP id bp10-20020a056e02348a00b0035fb462dd6amr15861572ilb.21.1703728853864; Wed, 27 Dec 2023 18:00:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703728853; cv=none; d=google.com; s=arc-20160816; b=deaeDGADWQTFfyy9EBMAlwtboyK0Qu78aLKymB08TgLi+xTsZc/WE9AOFguRy8mCk6 VLMCc2Sjx38J9iM0jmGmbkyViLkC8er8zOXc6eW4LllzQpTktB1gKQMDn1TzvazFqA8z OrPV+iu/TmVEHWw7VmJSxAq5y4f/lS6B0RqRuEK1THZKEfMqLz30AIMAvLS4ZkKT7rp/ wixtwioModUAr3ZVe2Ve73ns3lWp6YrB1LUDwxqsG211CScZxWYm1kohH2ArPN55/PIa 2WXkiT2RNWl/Vc06N6pRugQ+JdlUMJt0t3MVXc/LIYDLnEp5mVPa07alsjT4DVWkJGVc AYHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=8XYXLeAK9wBLJ9SgEUKly8RlAfrBLaG5dorpT3mCDAA=; fh=Bz3RizA2diWNTzaLSv4aT9xBmDGuUoAYmiwfDfvX78I=; b=JgUWMS+1p0sDKPr1oQetdp9+i3zk0ZNjPgi4pyRnRpTh/0bbF+nwE0/3H4Kt2W3skQ NIQLGWPDrGo7vMVCr/lzzDrqrP2ZNED8r8KCu0tbewFsAgctjH7lVIj1Z7aJX04YwsIv BviE7hgMCgafi+oXxSzHII4Pge/uUg5ww2hvP1cOHSve1iK+fnZFxWNpsfrgBVNViGfx Uqiapd/11L2COKkHA67iUemJVOXix/XIIjQ1OkdHDqf2y3988wJHC/FsfUigqWHAK5DB gPf/yZ6NvGZP6PAX7UzUaNue+ANKCLfM8+x22Gk9h8EDWriw7+x9MHaz/t9ZIY4uwD98 onqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JNaEPMIB; spf=pass (google.com: domain of linux-kernel+bounces-12386-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t9-20020a6564c9000000b005cdfddfe6b8si9031475pgv.725.2023.12.27.18.00.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 18:00:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12386-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JNaEPMIB; spf=pass (google.com: domain of linux-kernel+bounces-12386-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 77CE2283768 for ; Thu, 28 Dec 2023 02:00:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0AE6C1106; Thu, 28 Dec 2023 02:00:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JNaEPMIB" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B527A10E4 for ; Thu, 28 Dec 2023 02:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-594e14ac876so423659eaf.3 for ; Wed, 27 Dec 2023 18:00:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703728843; x=1704333643; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=8XYXLeAK9wBLJ9SgEUKly8RlAfrBLaG5dorpT3mCDAA=; b=JNaEPMIBUIfUi+HLlX+E0DD3m/tl1uP20a7SL1BtywGlxfGvAVK50wp2vQib7cKEdO PwB/K26ZJbd5hdX1wH0FhPJt775E+BOrBciNhlfUtaB/VDnlx7EBfn0olqO663XNAYBo Sv6hPaAlvzzzK2RLgDUVep+Ie7UbsTaLnWLK39wg9CUnrjc70yCSliH0VWIvd0Qmjn/g iYy6fI1JDJb4ItPEsObPDD+83iiqNSD+ZO+0kFP8+H9ONQdMyJ4VS1/wprZuIgew4JCd 2AeCQVI7ZEZmVKsh/ojgwSbz6gO/gI8p/0idgeUEWPDwAPexPJH7+zxzXHktmJNWlImR sWpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703728843; x=1704333643; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8XYXLeAK9wBLJ9SgEUKly8RlAfrBLaG5dorpT3mCDAA=; b=jyndNbLO0UgSJJzKLyQr4Pnp21SAqJJ8fA9S6z31YyjUcSNxW38Po5hNOwUUW3wkhv PL9eAQtdFmWC59rfSqrJZoZty7DrjgEnSBLr0WSrixG62+vs1HfnMN+KVqwo4XBVoMi6 NvqBFkjOELCT5kbl6SMwcyitUc767r706M48O3Qyx9JEHd4ygkfrokBTorVvZJ6xfumv /Qq/79/lNSpnId2JIDvXX9T4hmRC5mJ0UswbdWj9g2Cp13o/Eu+HxP97JjHeZp5zMMvv bqxTDEyJaRZJ/TrCu7o5JaKLgj2NFhF3yYSnVJTiYQQqxKSAzBm0L6wytaVapGX77U5W uAKg== X-Gm-Message-State: AOJu0YzOu8oazEjRpjamUnEj2v5M07Em3qCRks0a8KDNBQbgwVRqTXUc w/vrGbJRcC2PurLxeJAs64a/SKJZyho= X-Received: by 2002:a05:6358:2921:b0:170:bfb9:1cfc with SMTP id y33-20020a056358292100b00170bfb91cfcmr6974231rwb.1.1703728842738; Wed, 27 Dec 2023 18:00:42 -0800 (PST) Received: from localhost ([156.236.96.164]) by smtp.gmail.com with ESMTPSA id p23-20020a635b17000000b005c66b54476bsm11505761pgb.63.2023.12.27.18.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 18:00:42 -0800 (PST) Date: Thu, 28 Dec 2023 10:00:38 +0800 From: Yue Hu To: Gao Xiang Cc: linux-erofs@lists.ozlabs.org, Yue Hu , bugreport@ubisectech.com, LKML Subject: Re: [PATCH v2] erofs: fix inconsistent per-file compression format Message-ID: <20231228100038.00004fdf.zbestahu@gmail.com> In-Reply-To: <20231227050633.1507448-1-hsiangkao@linux.alibaba.com> References: <20231227041718.1428868-1-hsiangkao@linux.alibaba.com> <20231227050633.1507448-1-hsiangkao@linux.alibaba.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 27 Dec 2023 13:06:33 +0800 Gao Xiang wrote: > EROFS can select compression algorithms on a per-file basis, and each > per-file compression algorithm needs to be marked in the on-disk > superblock for initialization. > > However, syzkaller can generate inconsistent crafted images that use > an unsupported algorithm for specific inodes; thus, an unexpected > "BUG: kernel NULL pointer dereference" can be raised. > > Fix this by checking against `sbi->available_compr_algs` for each > compressed inode. Incorrect !erofs_sb_has_compr_cfgs preset bitmap > is now fixed together since it was harmless previously. > > Reported-by: > Fixes: 14373711dd54 ("erofs: add on-disk compression configurations") > Signed-off-by: Gao Xiang Reviewed-by: Yue Hu