Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3252163pxb; Mon, 25 Jan 2021 10:44:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaEweudI0EY9XcamQKI8yPEXWGOT4gMMJVzBU3bYzeURY324stK0KAywAJvhTzqBkErv3Y X-Received: by 2002:a17:907:a077:: with SMTP id ia23mr1155748ejc.434.1611600247199; Mon, 25 Jan 2021 10:44:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611600247; cv=none; d=google.com; s=arc-20160816; b=nJicCGoAybldkQKWDe73cs2elCwdph8WoIciMIfaGGIc4rKb4J3j8YMJscXvU/U+Fj dSjra4RwbdLjjr7cVoG2//S7NY7X0Hf2E2F9+ch6eOeAXxnlcij4EenUpRjPrCKc+K1A nA5Nj9SdEshIG43SIo/HPSv6QMQrPqB4vx8fRWnvSQQG8BvSv7NM17ChjbyML1M+Qfdt /PgPcNv65TOD+Vw6F8fX/wiPfSMM+5OOo+ZhuKKPE7RKtgamyWMbi2Av1YknvlEywwPf uiYYZtKrAbi5Q3p3BZF/cpPyAAZqNabEIbzlxd27v7EivFsNZnAB5tg1U3l+Gz1aM/KN n33w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xDrM+KQwor0G/SdbRtjD80RNmodxEJyJhIdhGXlFIgE=; b=YMLH1FNTgEyUk/qCvpGmq29V+TRVNtETTan7fCRhPE7GwiX5Y6KnvvZ5bwAE3cVEey FaYO3LNM+cA/irzjoVnTTpl6zkM2GnFrunHCMU5Ntv93f/+dOVdF88MXJ/RUbrTmnQxv Pt7NBGNHzjcJuksONJ9dO1wmp/YTlTMpTwV+urT3CLEJjNa8YzdIQYRHaAAcKQq2AxVu ScNadxFkYRS6y6xTPBeqfOYf97VXGzCo3/CJGJ5HybqN6yHClAB6RZ4FnoOh9BbXjsHz 0+LfzK72BhHLOLnKGmVGHWw3Su1ScpmflcSDf9Wu1pUfUuXluWh81s7mSMcz59TD+kz7 BX+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Bbshmc8Q; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si7882088eds.484.2021.01.25.10.43.42; Mon, 25 Jan 2021 10:44:07 -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=@infradead.org header.s=casper.20170209 header.b=Bbshmc8Q; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726755AbhAYSll (ORCPT + 99 others); Mon, 25 Jan 2021 13:41:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727159AbhAYSki (ORCPT ); Mon, 25 Jan 2021 13:40:38 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DA3AC0613D6; Mon, 25 Jan 2021 10:39:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xDrM+KQwor0G/SdbRtjD80RNmodxEJyJhIdhGXlFIgE=; b=Bbshmc8Qe42MDqnwjvOxasP4nj Vg4HA95P32VId9EjIS8lC5g7crddUHowjUGle9iSoJzYC9ITVWgU1+N0epXXW2BR48oQjssbHRPbp S4BsVHG2ffwIqPgw6CYgJw9a93Jt0lNLUt3unazR+sWDnmp2XBNDCiYSnjS7z+CzB1rZogCgwe/16 jPwELbppc6pf2eqpGwPUE+lXi5BNkApxd1aqbvqu2TLG0RUOBLzsj0Esi12oQk+94SeG7WeexeSlB JsW+Xj9r5Hkp6y+QeC8ho2w1svrfoBMml8PGCPDvaPRGnMExrc5NDRcihAT8RP3BAfUZiLBbHPIqa RNLoe2sA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l46li-004Wji-Nv; Mon, 25 Jan 2021 18:39:33 +0000 Date: Mon, 25 Jan 2021 18:39:18 +0000 From: Matthew Wilcox To: syzbot Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, namjae.jeon@samsung.com, sj1557.seo@samsung.com, syzkaller-bugs@googlegroups.com Subject: Re: UBSAN: shift-out-of-bounds in exfat_fill_super Message-ID: <20210125183918.GH308988@casper.infradead.org> References: <000000000000c2865c05b9bcee02@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000000000000c2865c05b9bcee02@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 25, 2021 at 09:33:14AM -0800, syzbot wrote: > UBSAN: shift-out-of-bounds in fs/exfat/super.c:471:28 > shift exponent 4294967294 is too large for 32-bit type 'int' This is an integer underflow: sbi->dentries_per_clu = 1 << (sbi->cluster_size_bits - DENTRY_SIZE_BITS); I think the problem is that there is no validation of sect_per_clus_bits. We should check it is at least DENTRY_SIZE_BITS and probably that it's less than ... 16? 64? I don't know what legitimate values are in this field, but I would imagine that 255 is completely unacceptable.