Skip to content

Commit b011522

Browse files
committed
Merge tag 'drm-misc-next-fixes-2021-09-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next-fixes for v5.15: - Make some dma-buf config options depend on DMA_SHARED_BUFFER. - Handle multiplication overflow of fbdev xres/yres in the core. Signed-off-by: Dave Airlie <[email protected]> From: Maarten Lankhorst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents de04744 + 8c28051 commit b011522

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/dma-buf/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ config UDMABUF
4242
config DMABUF_MOVE_NOTIFY
4343
bool "Move notify between drivers (EXPERIMENTAL)"
4444
default n
45+
depends on DMA_SHARED_BUFFER
4546
help
4647
Don't pin buffers if the dynamic DMA-buf interface is available on
4748
both the exporter as well as the importer. This fixes a security
@@ -52,6 +53,7 @@ config DMABUF_MOVE_NOTIFY
5253

5354
config DMABUF_DEBUG
5455
bool "DMA-BUF debug checks"
56+
depends on DMA_SHARED_BUFFER
5557
default y if DMA_API_DEBUG
5658
help
5759
This option enables additional checks for DMA-BUF importers and
@@ -74,7 +76,7 @@ menuconfig DMABUF_HEAPS
7476

7577
menuconfig DMABUF_SYSFS_STATS
7678
bool "DMA-BUF sysfs statistics"
77-
select DMA_SHARED_BUFFER
79+
depends on DMA_SHARED_BUFFER
7880
help
7981
Choose this option to enable DMA-BUF sysfs statistics
8082
in location /sys/kernel/dmabuf/buffers.

drivers/video/fbdev/core/fbmem.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
962962
struct fb_var_screeninfo old_var;
963963
struct fb_videomode mode;
964964
struct fb_event event;
965+
u32 unused;
965966

966967
if (var->activate & FB_ACTIVATE_INV_MODE) {
967968
struct fb_videomode mode1, mode2;
@@ -1008,6 +1009,11 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
10081009
if (var->xres < 8 || var->yres < 8)
10091010
return -EINVAL;
10101011

1012+
/* Too huge resolution causes multiplication overflow. */
1013+
if (check_mul_overflow(var->xres, var->yres, &unused) ||
1014+
check_mul_overflow(var->xres_virtual, var->yres_virtual, &unused))
1015+
return -EINVAL;
1016+
10111017
ret = info->fbops->fb_check_var(var, info);
10121018

10131019
if (ret)

0 commit comments

Comments
 (0)