Re: [PATCH v2] fbdev: fix incorrect address computation in deferred IO

2024-04-23 Thread Harshit Mogalapalli
Hi Nam, On 23/04/24 19:04, Nam Cao wrote: On Tue, Apr 23, 2024 at 06:56:52PM +0530, Harshit Mogalapalli wrote: Thanks everyone! I have tested the patched kernel with the syzkaller reproducer and couldn't see a problem. If you want to take credit for testing it, send us: Tested

Re: [PATCH v2] fbdev: fix incorrect address computation in deferred IO

2024-04-23 Thread Harshit Mogalapalli
alculation by using vmf->pgoff instead. With this change, the variable "offset" will no longer hold the exact offset value, but it is rounded down to multiples of PAGE_SIZE. But this is still correct, because this variable is only used to calculate the page offset. Reported-by: Hars

Re: [bug-report] task info hung problem in fb_deferred_io_work()

2024-04-19 Thread Harshit Mogalapalli
On 19/04/24 21:53, Nam Cao wrote: On 2024-04-19 Harshit Mogalapalli wrote: +CC stable( heads up as this is a regression affecting 5.15.y and probably others, Greg: this was reproducible upstream so reported everything w.r.t upstream code but initially found on 5.15.y) No worry about this, I

Re: [bug-report] task info hung problem in fb_deferred_io_work()

2024-04-19 Thread Harshit Mogalapalli
Hi Nam, +CC stable( heads up as this is a regression affecting 5.15.y and probably others, Greg: this was reproducible upstream so reported everything w.r.t upstream code but initially found on 5.15.y) On 19/04/24 20:29, Nam Cao wrote: On 2024-04-18 Harshit Mogalapalli wrote: While

Re: [bug-report] task info hung problem in fb_deferred_io_work()

2024-04-19 Thread Harshit Mogalapalli
Hi Takashi, On 19/04/24 13:15, Takashi Iwai wrote: On Fri, 19 Apr 2024 09:39:09 +0200, Then later on, the commit 33cd6ea9c067 changed cancel_*() to flush_delayed_work() blindly, and the known problem resurfaced again. I have reverted that commit, but still could see some other task hung

Re: [bug-report] task info hung problem in fb_deferred_io_work()

2024-04-19 Thread Harshit Mogalapalli
Hi Takashi, On 19/04/24 12:14, Takashi Iwai wrote: On Thu, 18 Apr 2024 21:29:57 +0200, Helge Deller wrote: On 4/18/24 16:26, Takashi Iwai wrote: On Thu, 18 Apr 2024 16:06:52 +0200, Nam Cao wrote: On 2024-04-18 Harshit Mogalapalli wrote: While fuzzing 5.15.y kernel with Syzkaller, we

Re: [bug-report] task info hung problem in fb_deferred_io_work()

2024-04-19 Thread Harshit Mogalapalli
Hi Nam, On 18/04/24 19:36, Nam Cao wrote: On 2024-04-18 Harshit Mogalapalli wrote: While fuzzing 5.15.y kernel with Syzkaller, we noticed a INFO: task hung bug in fb_deferred_io_work() Which framebuffer device are you using exactly? It is possible that the problem is with the device driver

Re: [bug-report] task info hung problem in fb_deferred_io_work()

2024-04-19 Thread Harshit Mogalapalli
Hi Patrik, On 18/04/24 18:44, Patrik Jakobsson wrote: On Thu, Apr 18, 2024 at 2:40 PM Harshit Mogalapalli wrote: Hi, While fuzzing 5.15.y kernel with Syzkaller, we noticed a INFO: task hung bug in fb_deferred_io_work() This is in 5.15.149 tag, and this is introduced by a set of commits

[bug-report] task info hung problem in fb_deferred_io_work()

2024-04-18 Thread Harshit Mogalapalli
Hi, While fuzzing 5.15.y kernel with Syzkaller, we noticed a INFO: task hung bug in fb_deferred_io_work() This is in 5.15.149 tag, and this is introduced by a set of commits: 2655757a3f10 fbdev: flush deferred IO before closing 15492bab7393 fbdev: Fix incorrect page mapping clearance at

Re: [PATCH v3] drm/panthor: Fix couple of NULL vs IS_ERR() bugs

2024-04-03 Thread Harshit Mogalapalli
Hi Boris, On 03/04/24 12:47, Boris Brezillon wrote: On Tue, 2 Apr 2024 07:14:11 -0700 Harshit Mogalapalli wrote: Currently panthor_vm_get_heap_pool() returns both ERR_PTR() and NULL(when create is false and if there is no poool attached to the VM) - Change the function to return

[PATCH v3] drm/panthor: Fix couple of NULL vs IS_ERR() bugs

2024-04-02 Thread Harshit Mogalapalli
() on failure. Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block") Signed-off-by: Harshit Mogalapalli --- This is spotted by smatch and the patch is only compile tested v1->v2: Fix the function panthor_vm_get_heap_pool() to only return error pointers and handle the caller sit

Re: [PATCH v2] drm/panthor: Fix couple of NULL vs IS_ERR() bugs

2024-04-02 Thread Harshit Mogalapalli
Hi Boris, On 02/04/24 19:32, Boris Brezillon wrote: On Tue, 2 Apr 2024 06:47:08 -0700 Harshit Mogalapalli wrote: 1. The devm_drm_dev_alloc() function returns error pointers. Update the error handling to check for error pointers instead of NULL. 2. Currently panthor_vm_get_heap_pool

[PATCH v2] drm/panthor: Fix couple of NULL vs IS_ERR() bugs

2024-04-02 Thread Harshit Mogalapalli
the function to return error pointers, when pool is NULL return -ENOENT - Also handle the callers to check for IS_ERR() on failure. Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block") Signed-off-by: Harshit Mogalapalli --- This is spotted by smatch and

Re: [PATCH] drm/panthor: Fix NULL vs IS_ERR() bug in panthor_ioctl_tiler_heap_destroy()

2024-04-02 Thread Harshit Mogalapalli
Hello Boris, On 02/04/24 18:03, Boris Brezillon wrote: Hello Harshit, On Tue, 2 Apr 2024 03:33:58 -0700 Harshit Mogalapalli wrote: panthor_vm_get_heap_pool() returns ERR_PTR on failure. Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block") Signed-off-by: Harshit M

Re: [PATCH] drm/panthor: Fix IS_ERR() vs NULL bug in group_process_tiler_oom()

2024-04-02 Thread Harshit Mogalapalli
Hi, On 02/04/24 16:47, Harshit Mogalapalli wrote: panthor_vm_get_heap_pool() returns ERR_PTR on failure, update the check accordingly. Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block") Signed-off-by: Harshit Mogalapalli --- This is based on static analysis with sm

[PATCH] drm/panthor: Fix IS_ERR() vs NULL bug in group_process_tiler_oom()

2024-04-02 Thread Harshit Mogalapalli
panthor_vm_get_heap_pool() returns ERR_PTR on failure, update the check accordingly. Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block") Signed-off-by: Harshit Mogalapalli --- This is based on static analysis with smatch, only compile tested. --- drivers/gpu/d

[PATCH] drm/panthor: Fix NULL vs IS_ERR() bug in panthor_probe()

2024-04-02 Thread Harshit Mogalapalli
The devm_drm_dev_alloc() function returns error pointers. Update the error handling to check for error pointers instead of NULL. Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block") Signed-off-by: Harshit Mogalapalli --- This is spotted by smatch and the patch is on

[PATCH] drm/panthor: Fix NULL vs IS_ERR() bug in panthor_ioctl_tiler_heap_destroy()

2024-04-02 Thread Harshit Mogalapalli
panthor_vm_get_heap_pool() returns ERR_PTR on failure. Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block") Signed-off-by: Harshit Mogalapalli --- This is spotted by smatch and the patch is only compile tested --- drivers/gpu/drm/panthor/panthor_drv.c | 4 ++-- 1 file

[PATCH] drm/amd/display: fix a possible NULL dereference bug

2024-02-15 Thread Harshit Mogalapalli
check. Fixes: 028bac583449 ("drm/amd/display: decouple dmcub execution to reduce lock granularity") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202311141141.golapxd5-...@intel.com/ Signed-off-by: Harshit Mogalapalli --- Only compile tested -

[PATCH] drm/rockchip: vop2: add a missing unlock in vop2_crtc_atomic_enable()

2024-01-19 Thread Harshit Mogalapalli
Unlock before returning on the error path. Fixes: 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588") Signed-off-by: Harshit Mogalapalli --- This is based on static analysis. Only compile tested. Note: Smatch found this. --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 ++

[PATCH] drm/amd/display: Fix memory leak in dm_set_writeback()

2023-12-08 Thread Harshit Mogalapalli
'wb_info' needs to be freed on error paths or it would leak the memory. Smatch pointed this out. Fixes: c81e13b929df ("drm/amd/display: Hande writeback request from userspace") Signed-off-by: Harshit Mogalapalli --- This is based on static analysis and only compile tested --- drive

Re: [PATCH] drm/crtc: Fix uninit-value bug in drm_mode_setcrtc

2023-12-07 Thread Harshit Mogalapalli
Hello, On 21/07/23 9:44 pm, Ziqi Zhao wrote: The connector_set contains uninitialized values when allocated with kmalloc_array. However, in the "out" branch, the logic assumes that any element in connector_set would be equal to NULL if failed to initialize, which causes the bug reported by

[PATCH next] drm/msm/dp: add a missing unlock in dp_hpd_plug_handle()

2023-12-04 Thread Harshit Mogalapalli
When pm_runtime_resume_and_get() fails, unlock before returning. Fixes: 5814b8bf086a ("drm/msm/dp: incorporate pm_runtime framework into DP driver") Signed-off-by: Harshit Mogalapalli --- This is based on static analysis with Smatch. Only compile tested. --- drivers/gpu/drm/msm/dp/dp

[PATCH next] drm/v3d: Fix missing error code in v3d_submit_cpu_ioctl()

2023-12-04 Thread Harshit Mogalapalli
it to -EINVAL. Fixes: aafc1a2bea67 ("drm/v3d: Add a CPU job submission") Signed-off-by: Harshit Mogalapalli --- This is based on static analysis and only compile tested. --- drivers/gpu/drm/v3d/v3d_submit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/v3d/v3d_submit.c

[PATCH v2] i915/perf: Fix NULL deref bugs with drm_dbg() calls

2023-10-27 Thread Harshit Mogalapalli
ko Ursulin Signed-off-by: Harshit Mogalapalli --- v1 --> v2: Remove the debug calls as they don't add much value and -ENOTSUPP is a good enough return value. --- drivers/gpu/drm/i915/i915_perf.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i91

Re: [PATCH] i915/perf: Fix NULL deref bugs with drm_dbg() calls

2023-10-27 Thread Harshit Mogalapalli
Hi Tvrtko, On 27/10/23 8:17 pm, Tvrtko Ursulin wrote: On 27/10/2023 15:11, Andrzej Hajda wrote: On 27.10.2023 16:07, Harshit Mogalapalli wrote: When i915 perf interface is not available dereferencing it will lead to NULL dereferences. Fix this by using DRM_DEBUG() which the scenario before

[PATCH] i915/perf: Fix NULL deref bugs with drm_dbg() calls

2023-10-27 Thread Harshit Mogalapalli
When i915 perf interface is not available dereferencing it will lead to NULL dereferences. Fix this by using DRM_DEBUG() which the scenario before the commit in the Fixes tag. Fixes: 2fec539112e8 ("i915/perf: Replace DRM_DEBUG with driver specific drm_dbg call") Signed-off-b

[PATCH next] drm/loongson: Fix error handling in lsdc_pixel_pll_setup()

2023-07-20 Thread Harshit Mogalapalli
to NULL checks instead. Fixes: f39db26c5428 ("drm: Add kms driver for loongson display controller") Signed-off-by: Harshit Mogalapalli --- This is found with static analysis with smacth and only compile tested. --- drivers/gpu/drm/loongson/lsdc_pixpll.c | 6 -- 1 file changed, 4 insert

[PATCH next] drm/msm/a5xx: Fix a NULL dereference bug in a5xx_gpu_init()

2023-06-26 Thread Harshit Mogalapalli
check. Fixes: 736a93273656 ("drm/msm/a5xx: really check for A510 in a5xx_gpu_init") Signed-off-by: Harshit Mogalapalli --- This is based on static analysis, only compile tested. --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

[PATCH next] drm/i915/huc: Fix missing error code in intel_huc_init()

2023-06-14 Thread Harshit Mogalapalli
. Fix this by adding the missing error code when VMA allocation fails. Fixes: 08872cb13a71 ("drm/i915/mtl/huc: auth HuC via GSC") Signed-off-by: Harshit Mogalapalli --- Found using Static analysis with Smatch, only compile tested. --- drivers/gpu/drm/i915/gt/uc/intel_huc.c | 1 + 1 file

[PATCH next] drm/amdgpu: Fix unsigned comparison with zero in gmc_v9_0_process_interrupt()

2023-05-22 Thread Harshit Mogalapalli
fault occurs") Signed-off-by: Harshit Mogalapalli --- This is from static analysis, only compile tested. --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9

[PATCH next] drm/amd/display: Fix possible NULL dereference in dc_dmub_srv_cmd_run_list()

2023-04-26 Thread Harshit Mogalapalli
ingle function") Signed-off-by: Harshit Mogalapalli --- Only compile tested. --- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_s

[PATCH] drm/pl111: Fix missing unwind goto in pl111_amba_probe()

2023-03-29 Thread Harshit Mogalapalli
So instead of directly returning, goto dev_put to fix this bug. Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111") Signed-off-by: Harshit Mogalapalli --- This is based on static analysis, Only Compile tested. --- drivers/gpu/drm/pl111/pl111_drv.c | 2 +- 1 file changed, 1 inse

[PATCH] drm/lima/lima_drv: Add missing unwind goto in lima_pdev_probe()

2023-03-13 Thread Harshit Mogalapalli
Smatch reports: drivers/gpu/drm/lima/lima_drv.c:396 lima_pdev_probe() warn: missing unwind goto? Store return value in err and goto 'err_out0' which has lima_sched_slab_fini() before returning. Fixes: a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs") Signed-off-b

[bug-report] Smatch warns unsigned comparison with zero in dw_mipi_dsi_rockchip_set_lcdsel()

2022-10-17 Thread Harshit Mogalapalli
Hi, Smatch warns: drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c:755 dw_mipi_dsi_rockchip_set_lcdsel() warn: unsigned 'dsi->cdata->lcdsel_grf_reg' is never less than zero. static void dw_mipi_dsi_rockchip_set_lcdsel(struct dw_mipi_dsi_rockchip *dsi,

[PATCH] drm/vkms: fix variable dereferenced before check warning

2022-09-08 Thread Harshit Mogalapalli
rmats") Signed-off-by: Harshit Mogalapalli --- drivers/gpu/drm/vkms/vkms_plane.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c index f4319066adcc..c3a845220e10 100644 --- a/drivers/gpu/drm/vkms/vkms_pla

Re: [PATCH] drm/v3d: Use kvcalloc

2022-03-29 Thread Harshit Mogalapalli
On 28/03/22 5:55 pm, Melissa Wen wrote: On 03/12, Harshit Mogalapalli wrote: kvcalloc is same as kvmalloc_array + __GFP_ZERO. Signed-off-by: Harshit Mogalapalli --- drivers/gpu/drm/v3d/v3d_gem.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/v3d

Re: [PATCH] drm/v3d: Use kvcalloc

2022-03-12 Thread Harshit Mogalapalli
Hi Joe, On 13/03/22 3:57 am, Joe Perches wrote: On Sat, 2022-03-12 at 07:26 -0800, Harshit Mogalapalli wrote: kvcalloc is same as kvmalloc_array + __GFP_ZERO. [] diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c [] @@ -308,9 +308,8 @@ v3d_lookup_bos(struct

[PATCH] drm/v3d: Use kvcalloc

2022-03-12 Thread Harshit Mogalapalli
kvcalloc is same as kvmalloc_array + __GFP_ZERO. Signed-off-by: Harshit Mogalapalli --- drivers/gpu/drm/v3d/v3d_gem.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index c7ed2e1cbab6..f7d37228461e 100644

[PATCH] drm/udl: Return correct error code on kmalloc failure

2022-01-17 Thread Harshit Mogalapalli
t;) Signed-off-by: Harshit Mogalapalli --- drivers/gpu/drm/udl/udl_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c index 930574ad2bca..b7a9c6d103ba 100644 --- a/drivers/gpu/drm/udl/udl_connect

[PATCH] drm: i915: display: intel_dmc: Fixes an unsigned subtraction which can never be negative.

2021-12-10 Thread Harshit Mogalapalli
pe A DMC plugging") Signed-off-by: Harshit Mogalapalli --- drivers/gpu/drm/i915/display/intel_dmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c index 0cab18f972d1..2f477c298b00 100644 ---