lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f76cee52-1230-4cd5-b6c2-9cf4f0823228@gmail.com>
Date: Thu, 2 Oct 2025 19:55:39 -0700
From: Chintan Patel <chintanlike@...il.com>
To: Thomas Zimmermann <tzimmermann@...e.de>,
 maarten.lankhorst@...ux.intel.com, maxime.ripard@...nel.org,
 airlied@...il.com, simona@...ll.ch
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
 syzbot+147ba789658184f0ce04@...kaller.appspotmail.com
Subject: Re: [PATCH v2] drm/vblank: downgrade vblank wait timeout from WARN to
 debug



On 10/1/25 23:34, Thomas Zimmermann wrote:
> Hi
> 
> Am 02.10.25 um 04:57 schrieb Chintan Patel:
>> When wait_event_timeout() in drm_wait_one_vblank() times out, the
>> current WARN can cause unnecessary kernel panics in environments
>> with panic_on_warn set (e.g. CI, fuzzing). These timeouts can happen
>> under scheduler pressure or from invalid userspace calls, so they are
>> not always a kernel bug.
>>
>> Replace the WARN with drm_dbg_kms() messages that provide useful
>> context (last and current vblank counters) without crashing the
>> system. Developers can still enable drm.debug to diagnose genuine
>> problems.
>>
>> Reported-by: syzbot+147ba789658184f0ce04@...kaller.appspotmail.com
>> Closes: https://syzkaller.appspot.com/bug?extid=147ba789658184f0ce04
>> Tested-by: syzbot+147ba789658184f0ce04@...kaller.appspotmail.com
>>
>> Signed-off-by: Chintan Patel <chintanlike@...il.com>
> 
> There should be no empty lines among those tags
> 
>>
>> v2:
>>   - Drop unnecessary in-code comment (suggested by Thomas Zimmermann)
>>   - Remove else branch, only log timeout case
>> ---
>>   drivers/gpu/drm/drm_vblank.c | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
>> index 46f59883183d..a94570668cba 100644
>> --- a/drivers/gpu/drm/drm_vblank.c
>> +++ b/drivers/gpu/drm/drm_vblank.c
>> @@ -1289,7 +1289,7 @@ void drm_wait_one_vblank(struct drm_device *dev, 
>> unsigned int pipe)
>>   {
>>       struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
>>       int ret;
>> -    u64 last;
>> +    u64 last, curr;
>>       if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
>>           return;
>> @@ -1305,7 +1305,12 @@ void drm_wait_one_vblank(struct drm_device 
>> *dev, unsigned int pipe)
>>                    last != drm_vblank_count(dev, pipe),
>>                    msecs_to_jiffies(100));
>> -    drm_WARN(dev, ret == 0, "vblank wait timed out on crtc %i\n", pipe);
>> +    curr = drm_vblank_count(dev, pipe);
> 
> Please don't call drm_vblank_count() here. It's not necessary for 
> regular operation. Simply keep the debug message as-is.
> 
>> +
>> +    if (ret == 0) {
> 
> "if (!ret)" is the preferred style.
> 
>> +        drm_dbg_kms(dev, "WAIT_VBLANK: timeout crtc=%d, last=%llu, 
>> curr=%llu\n",
>> +            pipe, last, curr);
> 
> Aligning the pipe argument with dev from the previous line is the 
> preferred style.
> 

Hi Thomas,

Thank you for your review and helpful suggestions.
I’ll drop the unnecessary comment and remove the else branch as you 
recommended.

I’ll send a v3 with these changes.

Best regards,
Chintan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ