ocfs2: validate xattr metadata bounds
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 2 repliesIn review
- v22 patches 4 repliesSuperseded
- v10 of 2 patches 1 replySuperseded
Changes in v3 from the cover letter
- Move inline xattr validation into ocfs2_validate_inode_block().
- Move non-indexed external xattr validation into ocfs2_validate_xattr_block().
- Validate indexed xattr bucket entries at bucket read time, after ECC verification.
- Keep get/list path checks as helper reuse instead of a separate consumer-only policy.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | ocfs2: validate inline xattrs during inode block validationfs/ fs/ fs/ | +103 | 0 replies | |
| 2/2 | ocfs2: validate external xattr entries when reading metadatafs/ | +80 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 0/2] ocfs2: validate xattr metadata bounds
From: Cen Zhang <[email protected]>
Hi,
This v3 moves the corrupted xattr metadata checks into the metadata validation paths Joseph pointed at.
Patch 1 validates inline xattr metadata from ocfs2_validate_inode_block() and keeps the get/list consumers using the same helper before they derive pointers from i_xattr_inline_size.
Patch 2 validates non-indexed external xattr blocks from ocfs2_validate_xattr_block(). Indexed xattr buckets do not pass through that validator, so their header and per-entry bounds are checked after bucket ECC verification in ocfs2_read_xattr_bucket().
Both issues were reproduced with crafted OCFS2 images under KASAN.
Changes since v2:
- Move inline xattr validation into ocfs2_validate_inode_block().
- Move non-indexed external xattr validation into ocfs2_validate_xattr_block().
- Validate indexed xattr bucket entries at bucket read time, after ECC verification.
- Keep get/list path checks as helper reuse instead of a separate consumer-only policy.
Cen Zhang (2):
ocfs2: validate inline xattrs during inode block validation
ocfs2: validate external xattr entries when reading metadata
fs/ocfs2/inode.c | 4 ++ fs/ocfs2/xattr.c | 211 +++++++++++++++++++++++++++++++++++++++-------- fs/ocfs2/xattr.h | 2 + 3 files changed, 183 insertions(+), 34 deletions(-)
Signature · 1 line
2.43.0