• Wei Chen's avatar
    fbdev: tgafb: Fix potential divide by zero · f90bd245
    Wei Chen authored
    fb_set_var would by called when user invokes ioctl with cmd
    FBIOPUT_VSCREENINFO. User-provided data would finally reach
    tgafb_check_var. In case var->pixclock is assigned to zero,
    divide by zero would occur when checking whether reciprocal
    of var->pixclock is too high.
    
    Similar crashes have happened in other fbdev drivers. There
    is no check and modification on var->pixclock along the call
    chain to tgafb_check_var. We believe it could also be triggered
    in driver tgafb from user site.
    Signed-off-by: default avatarWei Chen <harperchen1110@gmail.com>
    Signed-off-by: default avatarHelge Deller <deller@gmx.de>
    f90bd245
tgafb.c 42.6 KB