From nobody Wed Oct 8 18:15:15 2025 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 376B629ACFA; Wed, 25 Jun 2025 10:10:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.181.97.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750846258; cv=none; b=tzrDMGLHKNrsy3YRiNZl7Yb6QH7b+vo5m+erBgXztJFoMnU8KOh3qW+yHmG7b5EV0F/M6nyU4nB0dhCVSpEbmAsAlX9bAQ/gjmJpfAWBtoZMZt7Tx/iqeTDtSbioetN02Nx+wJ8mXOcU9/YZjNkqMH1vc9o7mwNZf9eBwbEDKUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750846258; c=relaxed/simple; bh=jJiZMdARSlaUy5Gkp3wE6lYkk6J5PcTRF0Hc0Gq8/VI=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=eCffA/ixdMLBiy8T+oarlRfVA5sti+RToSVlkDr/nrK3+mOkECH18cpj5oW0l+/gtjxEhuDVCEQuVenVL2vbiEwvRA1dG1+T2h4N5RW+obLyQvkiHtfwe4EvyF/lbx1LPFel47+NJFgepO6tA33B/O2KtCPUVx3nxjO527vzKXs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=I-love.SAKURA.ne.jp; spf=pass smtp.mailfrom=I-love.SAKURA.ne.jp; arc=none smtp.client-ip=202.181.97.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=I-love.SAKURA.ne.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=I-love.SAKURA.ne.jp Received: from www262.sakura.ne.jp (localhost [127.0.0.1]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 55PAAeaM066330; Wed, 25 Jun 2025 19:10:40 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from [192.168.1.6] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 55PAAdxw066301 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Wed, 25 Jun 2025 19:10:40 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <54358ab7-4525-48ba-a1e5-595f6b107cc6@I-love.SAKURA.ne.jp> Date: Wed, 25 Jun 2025 19:10:33 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Viacheslav Dubeyko , John Paul Adrian Glaubitz , Yangtao Li , Andrew Morton Cc: linux-fsdevel , LKML From: Tetsuo Handa Subject: [PATCH] hfsplus: don't use BUG_ON() in hfsplus_create_attributes_file() Content-Transfer-Encoding: quoted-printable X-Virus-Status: clean X-Anti-Virus-Server: fsav404.rs.sakura.ne.jp Content-Type: text/plain; charset="utf-8" syzkaller can mount crafted filesystem images. Don't crash the kernel when we can continue. Reported-by: syzbot Closes: https://syzkaller.appspot.com/bug?extid=3D1107451c16b9eb9d29e6 Signed-off-by: Tetsuo Handa Reviewed-by: Viacheslav Dubeyko Reviewed-by: Yangtao Li --- fs/hfsplus/xattr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c index 9a1a93e3888b..191767d4cf78 100644 --- a/fs/hfsplus/xattr.c +++ b/fs/hfsplus/xattr.c @@ -172,7 +172,11 @@ static int hfsplus_create_attributes_file(struct super= _block *sb) return PTR_ERR(attr_file); } =20 - BUG_ON(i_size_read(attr_file) !=3D 0); + if (i_size_read(attr_file) !=3D 0) { + err =3D -EIO; + pr_err("failed to load attributes file\n"); + goto end_attr_file_creation; + } =20 hip =3D HFSPLUS_I(attr_file); =20 --=20 2.49.0