(release/25.0) security: add integer overflow checks in allocation calculations - #3578
Conversation
- fb/fbpixmap.c: check width*bpp and height*paddedWidth overflows - hw/xfree86/common/xf86fbman.c: check length+gran-1 overflow, safe h computation, h*w overflow - hw/xfree86/drivers/modesetting/drmmode_display.c: validate multiplications before allocating shadow buffers - hw/xquartz/xpr/xprScreen.c: check displayCount * sizeof overflow - hw/xnest/Color.c: check ncolors * sizeof(uint32_t) overflow These prevent potential heap overflows due to wrapped sizes. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
…ations - fb/fbpixmap.c: check width*bpp and height*paddedWidth overflows - hw/xfree86/common/xf86fbman.c: check length+gran-1 overflow, safe h computation, h*w overflow - hw/xfree86/drivers/modesetting/drmmode_display.c: validate multiplications before allocating shadow buffers - hw/xquartz/xpr/xprScreen.c: check displayCount * sizeof overflow - hw/xnest/Color.c: check ncolors * sizeof(uint32_t) overflow These prevent potential heap overflows due to wrapped sizes. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> PR: #3578
Thorough security hardening — no objections. What it does: adds integer overflow checks to allocation size calculations across 5 files/subsystems, preventing heap overflows from wrapped sizes:
Patterns are correct: ABI impact: none. Internal allocation guards, no struct or export changes. Backport candidate: yes — heap overflow prevention via integer overflow. Security hardening; all three release lines should carry it. The fixes are pure guards (no behavior change on valid inputs), so cherry-pick risk is minimal. Minor note: Verdict: passes review. |
|
@X11Libre/dev ping |
…ations - fb/fbpixmap.c: check width*bpp and height*paddedWidth overflows - hw/xfree86/common/xf86fbman.c: check length+gran-1 overflow, safe h computation, h*w overflow - hw/xfree86/drivers/modesetting/drmmode_display.c: validate multiplications before allocating shadow buffers - hw/xquartz/xpr/xprScreen.c: check displayCount * sizeof overflow - hw/xnest/Color.c: check ncolors * sizeof(uint32_t) overflow These prevent potential heap overflows due to wrapped sizes. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> PR: #3578
Backport of #3578 (master)
These prevent potential heap overflows due to wrapped sizes.
Signed-off-by: Enrico Weigelt, metux IT consult info@metux.net