Re: [bug report] drm/ttm: Fix dummy res NULL ptr deref bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

On 8/11/2022 5:26 PM, Dan Carpenter wrote:
On Thu, Aug 11, 2022 at 04:36:33PM +0530, Arunpravin Paneer Selvam wrote:
Hi Dan,

drm-misc-fixes doesn't have the updated ttm_bo.c file, we have the updated
ttm_bo.c version in
drm-misc-next branch. Please find below for the line number 907.

On 8/11/2022 3:25 PM, Dan Carpenter wrote:
Hello Arunpravin Paneer Selvam,

This is a semi-automatic email about new static checker warnings.

The patch cf4b7387c0a8: "drm/ttm: Fix dummy res NULL ptr deref bug"
from Aug 9, 2022, leads to the following Smatch complaint:

      drivers/gpu/drm/ttm/ttm_bo.c:915 ttm_bo_validate()
      warn: variable dereferenced before check 'bo->resource' (see line 907)

drivers/gpu/drm/ttm/ttm_bo.c
     906		 */
     907		if (!ttm_resource_compat(bo->resource, placement)) {
                                           ^^^^^^^^^^^^
Unchecked dereference here inside the function.
|if (!bo->resource || !ttm_resource_compat(bo->resource, placement)) { we
have this version in drm-misc-next Regards, Arun |

Huh...  That's very interesting.  It appears there was a bug in
drm-misc-next, we applied the fix to the wrong tree, and now both trees
are wrong.  The drm-misc-next tree still has the bug and the other tree
has a static checker warning about nonsensical NULL checks.

Eventually drm-misc-next will get merged and everything will work.  Is
it too late to remove the bogus "CC: stable@xxxxxxxxxxxxxxx"?
I will look into this problem.
This could have been avoided if the NULL dereference fix had a Fixes tag.
I should have added the below tag
Fixes: 347987a2cf0d ("drm/ttm: rename and cleanup ttm_bo_init")

I will check on this.

Thanks,
Arun

regards,
dan carpenter





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux