Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3218415pxb; Tue, 19 Jan 2021 17:40:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9guDVsuePZHKzGGFJl7kWsGzpI1fnPeaDOpJXhEsDuSLw/t3yN9JzhEqK7oi3xxJroBjn X-Received: by 2002:a17:906:39d0:: with SMTP id i16mr4689218eje.18.1611106815019; Tue, 19 Jan 2021 17:40:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611106815; cv=none; d=google.com; s=arc-20160816; b=S220AmK3BK1MkxneF0roU/INnprNlZ6beN9o0BKztnkTCmGHWGkso9PITcP1gNDgGq TSrp/6wqPqUg4lluVLK1CKxUrkRpUZK6xpWCyQPkCxRnT2ewrVkS4SQHGa0R1aodN324 NnzuUCTUow4LzVSvNf2Um8lxlPjgxImxtPToJqyBxR5duCv/ToKzmvpBCj2qy9sPjYfs 1smaeVQwU98Etl/7KLskkpSaoC+ZP0jwYGOfWlL2UzrAfCWAGL8AHdfU70Wl7YcPV8Z0 aDFVPTGfhhXWh09y60+1gPwY+53Yw/idopHmoZP/006xKFqB4zqGLvcBQBUTKo5yHouH 4XOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=1r3dKINWGBdHXjMJC1pX7V+OOo+PzIVrin3K6Ha1Jh4=; b=uOCGu2WFy7BOCjjz3kqxGYoWhfbA2gyFh4siXgZw7BrQmIHbvJ+iqeQNjy22kliSND 8mXCe0SoFkDoftVeunenlvQcq0ZAdlqHj/68Ph7z4xnJf6n1+/T0cw1K2MPtos3lPMpU HoPWNMrmVWXnukSrdPs/aPLX1MEysaketD5MjqRo9C6kaEq6Uo54yYy4Ig62BG+KvruI cD/D11viIFBtFtXN+OqFyuFop9hD5Aof0Led0mBrPtwUbkPzx6TmMyjaLPoQ4Sixu3aW OsIIMiKw3BkB6ejbCmWSz4tgJSa5jOGtVPoNhb1Yl5Tp1aspk8XqtPAasUGKY31mvJra 5R6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=MjZ4X4M+; 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=REJECT sp=REJECT dis=NONE) header.from=aol.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cs10si152797ejc.200.2021.01.19.17.39.35; Tue, 19 Jan 2021 17:40:15 -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=@aol.com header.s=a2048 header.b=MjZ4X4M+; 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=REJECT sp=REJECT dis=NONE) header.from=aol.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730763AbhATBhr (ORCPT + 99 others); Tue, 19 Jan 2021 20:37:47 -0500 Received: from sonic303-25.consmr.mail.gq1.yahoo.com ([98.137.64.206]:39409 "EHLO sonic303-25.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727894AbhATBbi (ORCPT ); Tue, 19 Jan 2021 20:31:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1611106231; bh=1r3dKINWGBdHXjMJC1pX7V+OOo+PzIVrin3K6Ha1Jh4=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=MjZ4X4M+hAAdSJrooEMjWiu4d2rqipY0jHYmz+yIcK8EPnsP3kADx8TRVNEU0wr2RDW/7vblTjldHHaB21n2srmH31na0Gj1X7DV8rJesUQZEBdS6Zhr7eLZXgL81XqIy004bTHXKOp7/1GkDYEm0coSLTa97MYYOJDaQTO2i1vmPUuZRwKXKDXefbFnmPqLHXo6BKtksa2/BDy28t6u2iFMWby6AxakOzzrsig8sk+N7etPQDw3prbhMbZZaEoCXu5TiiHKxFkOd9O0Cz92eDANS1UksIb5itJ/aCTMaY7vNWgjvRYfDhI5prv96lI0KrCNNo6LOJ2Es0O3zxwlug== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1611106231; bh=d5jpnRbJVDDf7Yp5j1dV7v6CuALsI1NmlKOiPGhQ6tK=; h=From:To:Subject:Date:From:Subject:Reply-To; b=t58EtamcG++CecN+E/Um9dbCCY9wKwKDCFbYUAPJkyY42QomyUExPnkcD6ZkYVygYMb0/WFA/3qv0apPFZcHY7/AgDXZWWb0i3ZjAtUtVBF9DsPUY+gPox8xd1RGf8tsagxHZGn7EsCcNpK7t9FupSGfDG10NmWdorsVv7M6GTLVDRrgH2LyOVUpCe069iVcYYRzbyixah4cEZmPf7RezgHvlLp+ssDXgQpgWdmBJkDuDiliv5ryxv6zdNaRduuODJxml5EXoXbuQMO7eYwnEbsWzjddpUFbjZW4C37bgWGCTXIgpFiJZynXYKVGv9IGjEcNoGHeWZjY4gvd7BaUmQ== X-YMail-OSG: sKJOEZgVM1lAyTFEzCn_PceVGDrRNe6YHKgn2xwF.do4s3dzfXOt._Xe.VboZVI OSqXFtq6m3xDh1clCvSyH15l0lZZFGWLgTR.PtQxW9NL8r1jThVAfTRRSf_pd1Mtz3gMzyWeRKhy .gJJiIlPJduuSQNJuaSGwDnoHsUc7THCaibnSHaNku6I6xy2GjItRmOO55NaXq.yrbif0v6_Ir44 OuciNWyAEgX_tH5390.rQzNJNMcX8HgjRo.uqIIw49eGAfZS77KozGzgYsXnV3hFZaX8c24do9M. cB2tE9SuauQOOmOLa4ti4SmGe5mEYQLo3RXlyKVlzdrSKkD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jrK_7I4L2Wq eyXHci_X6ATfYDDk4xOpocGjLx1fel94WhamuW6WMy992uyEdfsbkaeol9.h0vUe51ZEVcr9BMVh .A37WCmZmiPIVcyHDXLo7gMBkDlADElhc3LNoeyG1AYmVhFGW69qdmOHLSrDAyILXoYYtMefeEPm SlxyS8nMllEtFu.6IdVPGRNqFDUWy_tO8HzfR0Jc3VEsar9eRcHHtExOWj_RWwCKizmghnrHZ.XA S60NGB2dwVEhT_1wrcf31chfeGi9LpZq1QMVymHLsO5CafQHZvXR6egL0cRqIcixAcV.vK8Y324. LhRwULBVBxiyqdu0KVw1tEgyN3HTYOV75ap9jT5smOR4Xg0GD7YlTW8Y- Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Wed, 20 Jan 2021 01:30:31 +0000 Received: by smtp402.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 167f1fbdd5ea7ffcc74dbd0fe3b1581e; Wed, 20 Jan 2021 01:30:28 +0000 (UTC) From: Gao Xiang To: linux-erofs@lists.ozlabs.org Cc: Chao Yu , LKML , syzkaller-bugs@googlegroups.com, Gao Xiang , syzbot+c68f467cd7c45860e8d4@syzkaller.appspotmail.com Subject: [PATCH] erofs: fix shift-out-of-bounds of blkszbits Date: Wed, 20 Jan 2021 09:30:16 +0800 Message-Id: <20210120013016.14071-1-hsiangkao@aol.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit References: <20210120013016.14071-1-hsiangkao.ref@aol.com> Content-Length: 987 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gao Xiang 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 Reported-by: syzbot+c68f467cd7c45860e8d4@syzkaller.appspotmail.com Signed-off-by: Gao Xiang --- 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 be10b16ea66e..d5a6b9b888a5 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -158,8 +158,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.24.0