Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp424236pxb; Wed, 24 Feb 2021 06:02:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzW6bB0TB9VQJUyxSHLp2VWfhscEWhiQojiDT7uK4d5L6Ie1jexGTd4PcnEBgPjj27ALQ54 X-Received: by 2002:aa7:c991:: with SMTP id c17mr33212395edt.165.1614175338663; Wed, 24 Feb 2021 06:02:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614175338; cv=none; d=google.com; s=arc-20160816; b=nldCilcUgDMQgAlT5mlUEWO7c78ZC5mNyyQw0+m4MWr/zcviwEsSZZ15sM/qcemzSe DhSt/IDrUCqeTTzxyxO8+ZOBWVmm5wYsEJVd/kwAN/eRAaV/61/WiVlW0wvDMCA3AZJn dqKSKSMj58e7FmywuBJCRbFcdsXQnaLMSG1GPcZ7mr0nwto1IskL4wjQNfFBootDWp+U yVOLF9lmQVVA/P4FjiDgWOfTM7cSbTbh8StZ93bl8jhlGrYA8vRWnaRNZm36KQKYZHwr YarDvl5UcXKAelVey3HMlOisNBWzNNNQQEV+W/j41oBaDZ/C8fY6UmB0HmoXuXmEvKTe 0k8A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p8ZGQzETx9JNbod+xj+J5gzCND5Y9T5odGylE2mZ6VQ=; b=Ui+Lh49NPFA+ouuQECL9cCqwS6eUcnjp/IPGIW9RBKZqtwKCd/Pu+TYKNZ3PfpBH9g Mu9pWbFkTXJxYO4/ns5lUyfyXUuUoHUPAUPy2NM+AHJsPZCgXa6kN8wTVqSioERh2iZn KFwvnqM1ma3dfd8jkb8QuZSDnksKBEmJEt6vaeIieFK9qG9tC1dsLnZBzQMvxvgfR7Al wqRusTeGRiv9Rh93r1QTEVj3G+6THFofCDD5F8Ty0hKuMSXOE6bFOVPzecTB6y2D01Ok wj6hbl0ftct6oeRmhN6LTPh81QPh56ejqGrdq2B+QOcxg5GNVa1GBudWOIQuDztRsexd 0Yhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nkgAEiNw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si1349480edb.432.2021.02.24.06.01.20; Wed, 24 Feb 2021 06:02:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nkgAEiNw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238177AbhBXN7H (ORCPT + 99 others); Wed, 24 Feb 2021 08:59:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:58430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235806AbhBXNHN (ORCPT ); Wed, 24 Feb 2021 08:07:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C63C564F8A; Wed, 24 Feb 2021 12:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614171265; bh=ZDSGtqQMqznruC3i1uHg8aXjYRDodJFZt8lPSkU8j7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nkgAEiNwQ9F2FAriAhKX0p1/O5aCmio35m9N3dDMCL4ZF3f5y3z/a//9uw/wbsI28 IMsSCrbjKo2xa/C2C/9QIQ0VzmJwcHdmAitl79Hrb8Yt+vUaLu2d8+ADYIOgsLmrWL FVYHUmIqG3TqjH/gU8eZU1j+b8RnGLGQltJMhLno5CNcEZBE3oXIpL9wHQnKSo3BFq R+qn4gTVSi7QmHqTeQYuYg0DRfMdwuYXvEJZbSsuBaaH5iWHtYP3JQHVjm9iB6N5hn PhD6MMpm6bnEK6ae4fafNL+CeRmMdzbytFAA1mSWOsKZz9TcuWvAyuG9Vwj+4EQnla hWGZGUEtljrrw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Gao Xiang , syzbot+c68f467cd7c45860e8d4@syzkaller.appspotmail.com, Chao Yu , Sasha Levin , linux-erofs@lists.ozlabs.org Subject: [PATCH AUTOSEL 5.4 34/40] erofs: fix shift-out-of-bounds of blkszbits Date: Wed, 24 Feb 2021 07:53:34 -0500 Message-Id: <20210224125340.483162-34-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210224125340.483162-1-sashal@kernel.org> References: <20210224125340.483162-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gao Xiang [ Upstream commit bde545295b710bdd13a0fcd4b9fddd2383eeeb3a ] syzbot generated a crafted bitszbits which can be shifted out-of-bounds[1]. So directly print unsupported blkszbits instead of blksize. [1] https://lore.kernel.org/r/000000000000c72ddd05b9444d2f@google.com Link: https://lore.kernel.org/r/20210120013016.14071-1-hsiangkao@aol.com Reported-by: syzbot+c68f467cd7c45860e8d4@syzkaller.appspotmail.com Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Sasha Levin --- fs/erofs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 0e369494f2f2c..22e059b4f745c 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -124,8 +124,8 @@ static int erofs_read_superblock(struct super_block *sb) blkszbits = dsb->blkszbits; /* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */ if (blkszbits != LOG_BLOCK_SIZE) { - erofs_err(sb, "blksize %u isn't supported on this platform", - 1 << blkszbits); + erofs_err(sb, "blkszbits %u isn't supported on this platform", + blkszbits); goto out; } -- 2.27.0