fbdev: fbmem: Fix the implicit type casting
In function do_fb_ioctl(), the "arg" is the type of unsigned long, and in "case FBIOBLANK:" this argument is casted into an int before passig to fb_blank(). In fb_blank(), the comparision if (blank > FB_BLANK_POWERDOWN) would be bypass if the original "arg" is a large number, which is possible because it comes from the user input. Fix this by adding the check before the function call. Reviewed-by: NGuenter Roeck <linux@roeck-us.net> Reviewed-by: NSam Ravnborg <sam@ravnborg.org> Acked-by: NHelge Deller <deller@gmx.de> Signed-off-by: NYizhuo Zhai <yzhai003@ucr.edu> Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20220202235811.1621017-1-yzhai003@ucr.edu
Showing
想要评论请 注册 或 登录