From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=104.30.16.97 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796422966; b=Mbwe0UDND9REaHXFS65yh4WICtLBKwi5hW1m8J5FoPF/Lw2jnZJnb27vnOr/WfpdrvGs 6TgdO+l8mQ2AX3xV2yrfovR+3KGtGBci9ync2c58l5FN6xVEANtL1B5d2yjeQffd7+BsH T3HW/yzxLgP0uOOBp2GXejqlwtnuoq0IVotLvNnIiVtrpHpprbDlDzeo0/snzwYkdOWRQ KpzlRqb2sNJaSNMutMHOrEzOtzrXovZLe57/j22hY7tn4+bAqEtCsg2X+FZJkCzfSW+y+ eXptst4bL0W4Dfpb63BM9tM+xQk3nf74M71AusOXRrCNkrnNMipUPruez5sG/4KA8Ug== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796422966; h=DMARC-Filter:DKIM2-Signature:Message-Instance:DKIM-Signature: DKIM-Signature:Feedback-ID:From:Message-ID:Date:Subject:To:References: In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=V1+Pyif7jrCyRPEZb8qzUiMcrAqeDa9NdFSDn9hYK58=; b=VOVBzn/jHCmoMOuOwWaRIWb9Qo5+szvJwMG5mPoO2xKyLW0U8aNuEy80J6oMfFGJg/14 +cY4H6TzkcREKqNeF31I4rQWHX1+dGPxlAoOEnIWpYzvqppkc26F/wPBCummU4DszQ+Ys mDCoiZDQF3H1o5gyXreMwXY2ST6IPdfRlPTyUE81qAFh4eiTon9grIU1TUzSxj4njeVtR uwE8Lm3UIZuq61EUSd6b8fXS2wf8aTxa5IvdYwGO2MpRiIE++uuQ9mVydIJkmZA8g+99o ktiu4f9x/50WpdJfDM53z9gIzTyYxQQJ+io/1HRw/Wl7G8SILvuthKeBMWLBInQvn7w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=talkjune.com; spf=pass smtp.mailfrom=cf-bounce.talkjune.com; dkim=pass header.d=talkjune.com header.i=@talkjune.com header.a=rsa-sha256 header.s=cf-bounce header.b=R+R2LebM; dkim=pass header.d=cloudflare-smtp.net header.i=@cloudflare-smtp.net header.a=rsa-sha256 header.s=cf2024-1 header.b=G6QYY9iP; arc=none smtp.remote-ip=104.30.16.97 Received: from bg-jh.cloudflare-smtp.net (bg-jh.cloudflare-smtp.net [104.30.16.97]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18FBE606A322 for ; Fri, 4 Dec 2026 22:22:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 18FBE606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=talkjune.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cf-bounce.talkjune.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=talkjune.com header.i=@talkjune.com header.a=rsa-sha256 header.s=cf-bounce header.b=R+R2LebM; dkim=pass (2048-bit key) header.d=cloudflare-smtp.net header.i=@cloudflare-smtp.net header.a=rsa-sha256 header.s=cf2024-1 header.b=G6QYY9iP DKIM2-Signature: i=1; m=1; t=1796422966; d=talkjune.com; mf=PGIxYXVqeHds cDN4N3hycXNkamh6bnpiMjJ6cDN1aWNxcmlmZTMzcWdobXV4ZGN0Z3NzM2FAY2YtYm91bmNl LnRhbGtqdW5lLmNvbT4=; rt=PGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc+; s= cf-bounce:rsa-sha256:ZFC4SsOQ0++yYYlv/sHlg+VER68SSNZoX1d9/877kwPfuvHKjp5A Qg3EmVF2PM2EIqqTC3ulskZI4sVwyl/VqlLqBapR+Ed6DrUDfoKFDK+nHbjbD+dNoGAnVjcj FOw67MgC6zwqTeCt/BamAKQGq2KcoT4oWeXvOIYq3q9S7JtqpkU2C2A4DJVrUljujcL+8X2f OqVWDAMy/mVH9K9Flu6n85p1+HXFGbUBBLGZBwVzy/RMWgj2nSKEhKsyoXEPsZ70ilsrwfz7 2bL34LmPy7sisZEccClIeYHAnwUotTyFoeaGp+MP04dezxdGkR7Jl98w+TFggLSSoMxydUDK ZQ==; Message-Instance: m=1; h=sha256:n7SpoA6jLkoy6PLVIMM7Saf4NDqNYMDRpawiahQI JGI=:2P9CR/RZMv1ttP1mLhQcYSlB30QJK80TUN8H214Wcs0=; DKIM-Signature: v=1; a=rsa-sha256; s=cf-bounce; d=talkjune.com; c=relaxed/relaxed; h=In-Reply-To:References:To:Subject:Date:From:Feedback-ID:from:reply-to:cc :resent-date:resent-from:resent-to:resent-cc:list-id:list-help :list-unsubscribe:list-unsubscribe-post:list-subscribe:list-post :list-owner:list-archive:otp-token:otp-token; t=1796422966; x=1797027766; bh= V1+Pyif7jrCyRPEZb8qzUiMcrAqeDa9NdFSDn9hYK58=; b=R+R2LebM3S0hAS7lK4HexdDOXDF jOqYSq/F3qO3aLLV0AjGVH83GGlySZbKSlKeSYlLqzjFPufdym0I2tPuENIjarIUwLVF6SXqt5G xFK3p0Z9qyKvKCKIoGGMEpZePStANdYCUYInjAg+fakidlZFCsJP54uVW6vvMVm92gl30ae7237 VzIt/u/EdS9i/p/xZNzYZ919wePdd6Sv/lhi9WmMRN7VNi6Umip++HigDHRXzY8QxTqBTesOJpA DU33n9wxbgCZT+G1EATFmjtCAKWYbaPcHrRpxhs+lqFjQnjIQnpYjzWPnJkAMh/Q+kWapj2nedw aUpKlvV3tcJBkAg==; DKIM-Signature: v=1; a=rsa-sha256; s=cf2024-1; d=cloudflare-smtp.net; c=relaxed/relaxed; h=In-Reply-To:References:To:Subject:Date:From:Feedback-ID:from:reply-to:cc :resent-date:resent-from:resent-to:resent-cc:list-id:list-help :list-unsubscribe:list-unsubscribe-post:list-subscribe:list-post :list-owner:list-archive:otp-token:otp-token; t=1796422966; x=1797027766; bh= V1+Pyif7jrCyRPEZb8qzUiMcrAqeDa9NdFSDn9hYK58=; b=G6QYY9iP299EobHRv0omlIYSWPZ tj3zcvo7CmwQSfLc/l8HcjxIDeX+bFhisAmObawdBzvb+GfxZcW/rc2XzIhIoXV9OiVI7fJEPbP e15BzcBJnH46J3LOChSzsg6QwvPEMh0QrUXHzBqLVNzoYX5vCOE7aYG0TtZZqSr6ZQ7kfDb1CCg rFqyye1IQJVMI8Ubr8yAxweg0zZDQles2+Zcng/f33vtZLukxVh8+S6el447RF5Ktd7LH9R5+rq 8+jmUvDUvNZrn+zBZQPGtzE4n/ajDk+8atuZEvi8jk5luFP+LeH6Cv0178dDqxZAqbHXZ8kFQSs p2gVlw7Hnyp8Myw==; Feedback-ID: talkjune.com:5:5:Cloudflare From: "Mar Dominguez" Message-ID: <13C30uJftWBGcsLXeedCzRVIfMjV8yaRbGM4@talkjune.com> Date: Fri, 04 Dec 2026 22:22:43 +0000 Subject: Re: [PATCH 0/3] hfs: fix writes to b-tree nodes larger than a page To: "Viacheslav Dubeyko" , "John Paul Adrian Glaubitz" , "Yangtao Li" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: In-Reply-To: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, 2026-12-04 at 19:32 +0000, Viacheslav Dubeyko wrote: > Please, correct me if I wrong. Have you implemented support of node > size bigger than 512 bytes in HFS? No, patch 1 didn't add a new feature. hfs_btree_open() has accepted any power-of-two node size since 2.6.12, and the read and node creation paths already loop over the pages of a node, so patch 1 only made the four write helpers do the same. [...] > So, we should support only 512 bytes node size. This a difference > between HFS and HFS+. HFS supports only 512 bytes b-tree nodes and > nodes share memory page. For the case of HFS+, b-tree node cannot be > smaller than 4K, if I remember correctly. I assume that we could have > issue in HFS b-tree nodes management code. But node size should be 512 > bytes always for the case of HFS. Agreed, thanks for the spec references. I've sent a v2 that replaces the series with one patch: hfs_btree_open() now rejects any node size other than 512 bytes, for both the catalog and the extents tree. That also closes the out-of-bounds write on crafted images, since a 512-byte node never crosses a page boundary: https://lore.kernel.org/linux-fsdevel/cqBIXnOxXx3ey7plxkEtHUghzAOub4g70HWj@= talkjune.com/ v2 drops the KUnit patch, since its cases were for nodes larger than a page. If you'd like KUnit tests for the write helpers on 512-byte nodes, I can send them as a separate patch. Thanks, Mar