From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 1AB783546C2 for ; Tue, 4 Aug 2026 20:48:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785876521; cv=none; b=JRvQ2yfgyIBEMDPGv6g8hhCh3W0nVYobukyP1c9m6BOo3/i+aYPFC06c7Vlct0tOtIsCiv4SU3kZamVNk1Q25sks/FbzXpZjiTQNoZ6oMuks6PgNVNDmsR+DyEk7QDKsHKS7I5mOSv4JhhBka6QsEF2GwkSVcWLyf8JcYo0lagk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785876521; c=relaxed/simple; bh=0fyOCz334IusZLgtfx3NtvyxUq8Kap+8aCWSQwkr0Kw=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=jHLw3nbKeJSMNhFHZyRlZgW/MXpJKj8cpRz4p3xIB3gDfnBbb2d7wn14rPuPIVI30O5XOOKZ30IJzXh49yIH3pxSg1Nz6jwxTYiEcd39WAsbdDCPENqGWnT1TUxHuUZ64nrPPMFKLVTGIkp72qpdTX/tBG6wbya+9bulfdjkEvA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=SxlnZjyc; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="SxlnZjyc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 125671F000E9; Tue, 4 Aug 2026 20:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1785876519; bh=3SDhrU0NkDDNHM07+4rEuDBp/JFEypon6XyhmIWeYqw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=SxlnZjyca/fmM+porxacsl/ZRq/jp1gitZ0LpRzfo+r3zGK7eJhA9pwreE6Fc4VvT 2Ajr+E8mlcE65lPg7QbgXBnDA/Vw6nRsQjE+JgvRlCCI6oZ8xmxZRaan7MjcdsRyhU SmT0lG/0wHtItcRa0uormxghm+Gm+QFHmrVaL22o= Date: Tue, 4 Aug 2026 13:48:38 -0700 From: Andrew Morton To: Phillip Lougher Cc: linux-kernel@vger.kernel.org, Yuejie Shi Subject: Re: [PATCH] Squashfs: check block offset is not negative Message-Id: <20260804134838.393c5c8f7ced5aa5fc799403@linux-foundation.org> In-Reply-To: <20260804194037.580032-1-phillip@squashfs.org.uk> References: <20260804194037.580032-1-phillip@squashfs.org.uk> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Tue, 4 Aug 2026 20:40:37 +0100 Phillip Lougher wrote: > If a negative offset is read off disk (for example the offset into the > decompressed fragment block), this will cause squashfs_copy_data() to > perform an out of bounds access. > > Fix by checking if offset is negative, and returning 0. This matches > existing behaviour where an offset beyond the block returns 0 bytes > copied. > > Fixes: f400e12656ab ("Squashfs: cache operations") I agree with your removal of cc:stable. "crafted image requires CAP_SYS_ADMIN" isn't a thing we should bother backporting. It's worth mentioning this in the changelog - let's please develop the habit of describing the userspace-visible impact of bugs when we fix them.