All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fbdev: fbmem: Fix the implicit type casting
@ 2022-01-31  6:57 ` Yizhuo Zhai
  0 siblings, 0 replies; 27+ messages in thread
From: Yizhuo Zhai @ 2022-01-31  6:57 UTC (permalink / raw)
  Cc: Yizhuo Zhai, Helge Deller, Daniel Vetter, Sam Ravnborg,
	Matthew Wilcox, Tetsuo Handa, Alex Deucher, Zhen Lei, Zheyu Ma,
	Xiyu Yang, linux-fbdev, dri-devel, linux-kernel

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.

Signed-off-by: Yizhuo Zhai <yzhai003@ucr.edu>
---
 drivers/video/fbdev/core/fbmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 0fa7ede94fa6..a5f71c191122 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -1064,7 +1064,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
 EXPORT_SYMBOL(fb_set_var);
 
 int
-fb_blank(struct fb_info *info, int blank)
+fb_blank(struct fb_info *info, unsigned long blank)
 {
 	struct fb_event event;
 	int ret = -EINVAL;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2022-02-05  5:43 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31  6:57 [PATCH] fbdev: fbmem: Fix the implicit type casting Yizhuo Zhai
2022-01-31  6:57 ` Yizhuo Zhai
2022-01-31 10:55 ` kernel test robot
2022-01-31 10:55   ` kernel test robot
2022-01-31 10:55   ` kernel test robot
2022-01-31 11:36 ` kernel test robot
2022-01-31 11:36   ` kernel test robot
2022-01-31 11:36   ` kernel test robot
2022-01-31 12:27 ` kernel test robot
2022-01-31 12:27   ` kernel test robot
2022-01-31 12:27   ` kernel test robot
2022-02-01  2:35   ` [PATCH v2] " Yizhuo Zhai
2022-02-01  2:35     ` Yizhuo Zhai
2022-02-02  9:02     ` David Laight
2022-02-02  9:02       ` David Laight
2022-02-01 15:02 ` [PATCH] " Helge Deller
2022-02-01 15:02   ` Helge Deller
2022-02-01 22:37   ` Yizhuo Zhai
2022-02-02 17:27   ` Sam Ravnborg
2022-02-02 17:27     ` Sam Ravnborg
2022-02-02 17:36     ` Helge Deller
2022-02-02 17:36       ` Helge Deller
2022-02-02 22:58       ` Yizhuo Zhai
2022-02-02 23:16       ` [PATCH v4] " Yizhuo Zhai
2022-02-02 23:16         ` Yizhuo Zhai
2022-02-02 23:16         ` Yizhuo Zhai
2022-02-02 23:16           ` Yizhuo Zhai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.