smb: client: fix DACL rewrite overflows
Status from this message: Applied.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 2 repliesApplied
- v11 patch 2 repliesSuperseded
Changes in v3 from the cover letter
- Patch 1 unchanged (already Reviewed-by Namjae Jeon)
- Patch 2: widened nsize from u16 to u32 and added explicit overflow guard instead of relying on check_add_overflow (which gcc optimized away for a u16 accumulator)
- Patch 2: fixed build_sec_desc() to propagate error from set_chmod_dacl() when it fails (discovered during testing)
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | smb: client: fix heap overflow in DACL owner/group rewritefs/ | +7 | 0 replies | |
| 2/2 | smb: client: fail DACL rewrite when the new DACL exceeds 64Kfs/ | +26 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Namjae Jeon |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/2] smb: client: fix DACL rewrite overflows
Two overflow fixes in the CIFS DACL owner/group rewrite path:
1. Patch 1 fixes a heap overflow when copying ACEs whose total size exceeds what kmalloc() allocated. The allocation used the old (pre-rewrite) ACE count, but the copy loop iterated over the new count.
2. Patch 2 fixes a u16 accumulator overflow in the size calculation that could wrap around for DACLs with 800+ ACEs, causing the check in patch 1 to pass despite the actual size exceeding 64KB. Returns -EOVERFLOW when this would occur.
Changes since v2:
- Patch 1 unchanged (already Reviewed-by Namjae Jeon)
- Patch 2: widened nsize from u16 to u32 and added explicit overflow guard instead of relying on check_add_overflow (which gcc optimized away for a u16 accumulator)
- Patch 2: fixed build_sec_desc() to propagate error from set_chmod_dacl() when it fails (discovered during testing)
Bjoern Doebel (2):
smb: client: fix heap overflow in DACL owner/group rewrite
smb: client: fail DACL rewrite when the new DACL exceeds 64K
fs/smb/client/cifsacl.c | 51 ++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 18 deletions(-)
Signature · 1 line
2.50.1