Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1192580lqd; Thu, 25 Apr 2024 08:21:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMSM/T4i5I9Tu5LIi1vkJUds2v8TeDdrHt4PBlYsAOp/mrhMwSiM5X9WZBiRm1hG4jtHgXAPUDZ8dNrx9DPxONuXNCaG26w/PoNmW4+Q== X-Google-Smtp-Source: AGHT+IGX4ErEL1sO/FBUxovQ36LPYUI6DVk/jSavcdaGZxsRFebVb73hBqqoZIiEhZ0vvFWe5Wdd X-Received: by 2002:a19:6417:0:b0:51b:f7cd:f33 with SMTP id y23-20020a196417000000b0051bf7cd0f33mr3583618lfb.27.1714058514509; Thu, 25 Apr 2024 08:21:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714058514; cv=pass; d=google.com; s=arc-20160816; b=RBQj7Dd0/wBIDvDiLwKOXz8I5VyVHnHWmpm4WDwABQXPpyB9avu8adHg4vePv0pUNO /weSEljXxhEPWwlvlWjuVoB25zp7Mkce3utD/DFjqj8lcymp2kwvFLWDZuqY3W9PwegC JkzlX26CRUCsNOWmgA96cJCkNtiuYTByWdaB/e88PE2UzWHMQvFWVfLr6n/2qsL235bd S+bdvAZSweZskYEF2ABQLX0b8UCTvP89hz3C167XyeprYt6kaiLpW3f297NtSvx7m3WP sfllfzBh2P+Cq28e47L2ZrqpMIhg7WLapeX0+PeyRYwDh7oAPHuwlJ2SSLWVp/4cyEkm TiQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KAaKjBOmTmKtiwXbnEwj76/jYmsGdqRarPPNKoQCzpQ=; fh=X/2q6L3bK6rpihEFMezvaFo0j5dFE44S0pbKk7rdV/g=; b=w3gsxnWD/yAJdyhbmxHUTCefimnohSfFEJ81TkFxGYxmAun5S2hYOhKtiXDxrTNDqk JQNFDm62czl/6QVDHh/45SKBPgfvQ4q7n478qAc2tIClKXCq+8RPKvJRLV85dXo/VPbL qdjdFJ9EzBCoarfQzjg/0bm7DCSQy6fUHbdHM/Q+QVrMT8d13byL/f0N3b1/xqHLLBxk g1Mnah57nmwMYY3JKn3AlloCbNrDIDeWusMRUL3ur7P8Bb7ykdjz9PnIq/iu9D3FrvVZ qSxQdEdGCn/H6y++Jzh1cmVd9by4TTbat7qec3UOxkIS3xwJc7bKr+Zhge+2VSN1rKyb QJ4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pSBnG9S5; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-158560-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158560-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j18-20020a508a92000000b005722a0f451dsi2950664edj.183.2024.04.25.08.21.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 08:21:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158560-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pSBnG9S5; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-158560-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158560-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2EFB71F222E6 for ; Thu, 25 Apr 2024 12:54:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2EC5149C6E; Thu, 25 Apr 2024 12:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="pSBnG9S5" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 8B4CE1494D8; Thu, 25 Apr 2024 12:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714049606; cv=none; b=kNZ9R2KNPY3019MXaFL3yzxg9RA80YDd/7woaqLOOgkaztwz4yT/grHU72lJqJ/W15QYVzrJ8YsN74sXBBtIUT9sICu/CpuGOUPtugD/gpyiRFGCiPkbCghPx+Fnb0zDsmyKhe0cZUs/GFLgXJ/2jej4oX15KnmSDBhZ6B3nnpg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714049606; c=relaxed/simple; bh=fy8j5zTS5R9p5dLel/NsA3+rvhAU+p9UzfYeBFb2gz0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p7vqkIuYnBl1wTWUajJ5pWYFVF8GkDy339Hke4F8KY1r6g+6DbPGcKpPBQ2dEcfOKI4irgaW9KUV0E6vD9ThBsl4yhiM/jVGQdNyQ18soZ8ETFlLZfE6JFZK0OsnFDUhwwTiDA0qDqZVQGer1MC4KPirciR61qj+AprpqUQsa2o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=pSBnG9S5; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org 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=KAaKjBOmTmKtiwXbnEwj76/jYmsGdqRarPPNKoQCzpQ=; b=pSBnG9S50M2h95Gw323PvYrCgU eS3udHqR1Aurzel+p6jTZ6oKATg1OaRBD1LcpDgbeVilplQdGrZbWJY8VQrMpK9MeDRKbqZTLzJYK IAkhW223WdCj1azUPJ2lNZu9lsdB/kPXanRPhTAsbsiQ/HMrHuo0mIT5MqyqgLrcStQi8lLtxWdzn 0/vlJ6WPiUc4BgNOtOpETbKz2+VpO6mStBkqx0OsgBBY7FFBdIV345P+vxJTCIiYOpWsVg6Tki0Sx QY0QucCSuYkWnSX/Kb9e/irflumoOnJirnxvx5RCZr8p4m8QnCAPuS4EgY8jdZmsZyvHoR0y5INSW f3n+YjHw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzybD-000000033Bg-24jW; Thu, 25 Apr 2024 12:53:15 +0000 Date: Thu, 25 Apr 2024 13:53:15 +0100 From: Matthew Wilcox To: Jeongjun Park Cc: brauner@kernel.org, eadavis@qq.com, jfs-discussion@lists.sourceforge.net, jlayton@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, shaggy@kernel.org, syzbot+241c815bda521982cb49@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com Subject: Re: [PATCH] jfs: Fix array-index-out-of-bounds in diFree Message-ID: References: <20240425124433.28645-1-aha310510@gmail.com> 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-Disposition: inline In-Reply-To: <20240425124433.28645-1-aha310510@gmail.com> On Thu, Apr 25, 2024 at 09:44:33PM +0900, Jeongjun Park wrote: > Through direct testing and debugging, I've determined that this > vulnerability occurs when mounting an incorrect image, leading to > the potential passing of an excessively large value to > 'sbi->bmap->db_agl2size'. Importantly, there have been no instances > of memory corruption observed within 'sbi->bmap->db_agl2size'. > > Therefore, I think implementing a patch that terminates the > function in cases where an invalid value is detected. If that's the problem then the correct place to detect & reject this is during mount, not at inode free time.