libipt: check section boundaries in pt_section_read()

When reading from a mapped section, we perform all kinds of overflow checks in
the various read functions.  And we still missed an overflow on systems with
32-bit pointers.

Move the check to pt_section_read() where we check the requested offset against
the section size.  Also truncate the read request there, if necessary.

This fixes the overflow on systems with 32-bit pointers.

Change-Id: I3c4591dcde113e2696347298af5ad3671ef0e41c
Signed-off-by: Markus Metzger <>
5 files changed
tree: d72e751d8f551d97623eab0e9bcb0e873482f3f6
  1. doc/
  2. include/
  3. libipt/
  4. ptunit/
  5. .gitignore
  6. CMakeLists.txt