x86/ptrace: Prevent truncation of bitmap size
authorThomas Gleixner <tglx@linutronix.de>
Mon, 11 Nov 2019 22:03:15 +0000 (23:03 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 16 Nov 2019 10:23:59 +0000 (11:23 +0100)
commit8c40397f22a4ff7996d3abdc2d9d1d90f9fc8054
treefe1c769e70c4cd50c7a1da6589c3625d030a3ce6
parent31f4f5b495a62c9a8b15b1c3581acd5efeb9af8c
x86/ptrace: Prevent truncation of bitmap size

The active() callback of the IO bitmap regset divides the IO bitmap size by
the word size (32/64 bit). As the I/O bitmap size is in bytes the active
check fails for bitmap sizes of 1-3 bytes on 32bit and 1-7 bytes on 64bit.

Use DIV_ROUND_UP() instead.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
arch/x86/kernel/ptrace.c