Commit Graph

29 Commits

Author SHA1 Message Date
Mintsuki
35ade5f557 misc: Remove unnecessary casts in CHECKED_ADD/CHECKED_MUL calls 2026-04-02 22:21:54 +02:00
Mintsuki
1c2942c5f8 lib/part: Check for overflow in cache block size calculation 2026-04-02 01:44:58 +02:00
Mintsuki
1b5b8e4620 misc: Add CHECKED_MUL macro, use it for all overflow-checked multiplications 2026-04-02 01:44:58 +02:00
Mintsuki
cc586e6cc0 misc: Use CHECKED_ADD for overflow-checked additions 2026-03-31 15:31:50 +02:00
Mintsuki
a572d94ca5 lib/part: Add overflow check to cache_block() end sector calculation 2026-02-05 13:10:31 +01:00
Mintsuki
5f421d27d5 lib/part: Clamp xfer_size to remaining sectors in volume in cache_blocks()
Do this rather than retrying over and over which can cause hangs on certain machines besides it being uglier code.

It also fixes an issue where the block cache will be incomplete if decrementing xfer_size, without checks for that.
2026-02-05 10:22:06 +01:00
Mintsuki
352fb9a6cf drivers/disk: Normalise sect_count to always be in 512-byte blocks 2026-02-04 07:42:27 +01:00
Mintsuki
f08bda6dd2 part: Remove mathematically impossible overflow check 2026-01-13 01:03:08 +01:00
Mintsuki
0602546ad2 fs,lib: Check volume_read() and read_cluster_from_map() return values 2026-01-04 16:11:05 +01:00
Mintsuki
3db3f0971a misc: Replace some integer overflow check patterns with builtin functions 2025-12-28 00:13:26 +01:00
Mintsuki
4515fa62dc lib/part: Ensure that the sect_count variable is not -1 before computing part_size 2025-12-27 20:58:50 +01:00
Mintsuki
40f84d0e77 fs, lib/part: Use builtin overflow detection for arithmetic operations 2025-12-26 11:14:57 +01:00
Mintsuki
3e5eb63856 lib/part: Add bounds checking to volume_read() function 2025-12-26 02:46:47 +01:00
Mintsuki
6598649c02 lib/part: Get rid of overzealous check added in 055e9a203a 2025-12-24 23:02:09 +01:00
Mintsuki
055e9a203a lib/part: Miscellaneous security and bug fixes 2025-12-24 22:18:11 +01:00
Mintsuki
d0e8016ed7 lib/part: Remove ancient echfs partition check 2025-11-23 04:29:16 +01:00
mintsuki
c44f514738 misc: Rename UEFI and BIOS define macros 2022-09-02 02:29:12 +02:00
mintsuki
07080dcbc2 misc: blib.h -> misc.h 2022-08-26 23:44:47 +02:00
mintsuki
c23eac8018 mbr: Make detection more lax. Addresses #185 2022-07-28 22:48:04 +02:00
mintsuki
ffb4ba6f55 mbr: Relax MBR validation requirements. Closes #195 2022-07-16 17:32:27 +02:00
mintsuki
62c029c218 chainload: Implement MBR_ID config option. Closes #190 2022-07-11 01:30:54 +02:00
mintsuki
1ac1343059 mbr: Add extra FAT32 and NTFS signatures to validity check 2022-07-10 22:46:08 +02:00
mintsuki
180eb8490a part: Misc EBR-related bug fixes. Fixes #189 2022-07-06 03:17:11 +02:00
mintsuki
0f5a467a78 uri: Add fslabel:// URI scheme as mentioned in #188 2022-07-02 10:43:10 +02:00
mintsuki
857dcbbfe7 part: Fix broken sector count normalisation calculation 2022-07-01 18:32:18 +02:00
mintsuki
20640083d8 part: Fix long standing issue with GPT logical block sizes and implement lsvol console command 2022-07-01 17:30:53 +02:00
mintsuki
c8973ed681 fat: Improve detection code 2022-05-07 16:24:04 +02:00
mintsuki
a51f8a39c0 limine: Add modules request 2022-03-16 06:49:41 +01:00
mintsuki
400202d926 misc: stage23 -> common 2022-02-03 10:38:43 +01:00