Searched hist:e3c4abdb3bc9b76bedd416ecc5c27633a2f8afed (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/drivers/gpu/drm/rockchip/ |
H A D | rockchip_drm_gem.c | diff e3c4abdb3bc9b76bedd416ecc5c27633a2f8afed Tue Sep 22 23:34:34 CDT 2015 Mark Yao <mark.yao@rock-chips.com> drm/rockchip: fix wrong pitch/size using on gem
args->pitch and args->size may not be set by userspace, sometimes userspace only malloc args and not memset args to zero, then args->pitch and args->size is random, it is very danger to use pitch/size on gem.
pitch's type is u32, and min_pitch's type is int, example, pitch is 0xffffffff, then pitch < min_pitch return true, then gem will alloc very very big bufffer, it would eat all the memory and cause kernel crash.
Stop using pitch/size from args, calc them from other args.
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
|