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 <markus.t.metzger@intel.com>
5 files changed
tree: d72e751d8f551d97623eab0e9bcb0e873482f3f6
  1. .gitignore
  2. CMakeLists.txt
  3. LICENSE
  4. README
  5. doc/
  6. include/
  7. libipt/
  8. ptunit/