Skip to content

pack-bitmap: miscellaneous mmap read hardening

Taylor Blau git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6pack-bitmap.c: hide bitmap internals in `read_u8()`pack-bitmap.c+6 -62 replies
2/6pack-bitmap.c: hide bitmap internals in `read_be32()`pack-bitmap.c+4 -40 replies
3/6pack-bitmap.c: drop unnecessary 'inline'spack-bitmap.c+2 -21 reply
4/6pack-bitmap.c: factor out manual `map_pos` manipulationpack-bitmap.c+22 -08 replies
5/6pack-bitmap.c: use `bitmap_index_seek()` where possiblepack-bitmap.c+13 -87 replies
6/6pack-bitmap.c: factor out `bitmap_index_seek_commit()`pack-bitmap.c+18 -114 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] pack-bitmap: miscellaneous mmap read hardening

This short series has a few minor refactorings and hardenings I noticed while reading the pack-bitmap.c code recently.

The series is structured as follows:

- The first three are cleanups to the read_be32() and read_u8() functions that could be taken on their own.

- The last three replace manually reading from bitmap_git->map and adjusting bitmap_git->map_pos accordingly with a new bitmap_index_seek() wrapper that accomplishes the same with additional bounds- and overflow-checking.

Thanks in advance for your review.

Taylor Blau (6):
pack-bitmap.c: hide bitmap internals in read_u8() pack-bitmap.c: hide bitmap internals in read_be32() pack-bitmap.c: drop unnecessary 'inline's pack-bitmap.c: factor out manual map_pos manipulation pack-bitmap.c: use bitmap_index_seek() where possible pack-bitmap.c: factor out bitmap_index_seek_commit()

 pack-bitmap.c | 84 ++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 59 insertions(+), 25 deletions(-)
Signature · 1 line
2.40.0.77.gd564125b3f