ocfs2: validate inline xattr header consumers
Status from this message: [merged mm-nonmm-stable] ocfs2-validate-inline-xattr-header-before-reflinking-inline-xattrs.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 All 5 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | ocfs2: validate inline xattr header before ibody lookupsfs/ | +47 | 1 reply | Applied |
| 2/5 | ocfs2: validate inline xattr header before checking outside valuesfs/ | +4 | 1 reply | Applied |
| 3/5 | ocfs2: validate inline xattr header before ibody removefs/ | +3 | 1 reply | Applied |
| 4/5 | ocfs2: validate inline xattr header before inline refcount attachfs/ | +6 | 1 reply | Applied |
| 5/5 | ocfs2: validate inline xattr header before reflinking inline xattrsfs/ | +13 | 1 reply | Applied |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Joseph Qi |
|---|---|
| 1/5 | R-b |
| 2/5 | R-b |
| 3/5 | R-b |
| 4/5 | R-b |
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/5] ocfs2: validate inline xattr header consumers
Corrupt i_xattr_inline_size can move the computed inode-body xattr header outside the dinode block. Several OCFS2 paths then trust xh_count or xattr entry geometry from that unchecked header.
The reported KASAN splat hits the ibody lookup path:
BUG: KASAN: use-after-free in ocfs2_xattr_find_entry+0x37b/0x3a0 ocfs2_xattr_ibody_get() ocfs2_xattr_get_nolock() ocfs2_calc_xattr_init()
The same unchecked header derivation also exists in the outside-value probe, ibody remove, inline refcount attach, and inline reflink paths.
This series factors the existing ibody list validation into a shared helper and then converts the remaining inline-header consumers one at a time.
Patch layout:
1. validate ibody get/find and reuse the helper in ibody list
2. validate the outside-value probe
3. validate ibody remove
4. validate inline refcount attach
5. validate inline reflink
ZhengYuan Huang (5):
ocfs2: validate inline xattr header before ibody lookups
ocfs2: validate inline xattr header before checking outside values
ocfs2: validate inline xattr header before ibody remove
ocfs2: validate inline xattr header before inline refcount attach
ocfs2: validate inline xattr header before reflinking inline xattrs
fs/ocfs2/xattr.c | 123 ++++++++++++++++++++++++++++------------------- 1 file changed, 73 insertions(+), 50 deletions(-)
Signature · 1 line
2.43.0