]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
security: Round 3 complete - parsers boot/storage validation
authorTulio A M Mendes <[email protected]>
Mon, 25 May 2026 18:15:35 +0000 (15:15 -0300)
committerTulio A M Mendes <[email protected]>
Mon, 25 May 2026 18:15:35 +0000 (15:15 -0300)
commite36dec73dfdb054a2ecbf483ca52f1a9a900595d
treefe9a32f30e1a142ab97091f88d03aefb3068fed2
parent6e6eceb3fb298e71196cf94980e4f15bbf6887da
security: Round 3 complete - parsers boot/storage validation

- A15: Multiboot2 parser validation (arch_early_setup.c):
  - Validate total_size range (8-65536 bytes)
  - Validate tag size (minimum 8 bytes)
  - Validate tag doesn't exceed buffer
  - Use cursor-based iteration with 8-byte alignment for next tag

- F01: ext2 strict validation (ext2.c):
  - Validate rec_len >= 8 in all directory entry loops
  - Validate rec_len % 4 == 0 (4-byte alignment)
  - Validate rec_len doesn't exceed block boundary
  - Validate name_len < rec_len - 8
  - Applied to: ext2_finddir, ext2_readdir_impl, ext2_dir_add_entry, ext2_dir_remove_entry, ext2_dir_find_entry, ext2_dir_is_empty

Tests: 119/119 PASS (smoke test, SMP=4)
src/arch/x86/arch_early_setup.c
src/kernel/ext2.c