mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: usb: siano: do not free urb-specific transfer buffer
@ 2025-05-22 14:00 Nikita Zhandarovich
  2025-06-09 10:37 ` Nikita Zhandarovich
  0 siblings, 1 reply; 2+ messages in thread
From: Nikita Zhandarovich @ 2025-05-22 14:00 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Nikita Zhandarovich, Hans Verkuil, linux-media, linux-kernel,
	lvc-project, Hillf Danton, syzbot+b466336413a1fba398a5

Since siano driver uses separately allocated buffers for urb tranfers,
such as smscore_buffer_t *cb, and deals with them accordingly
via calls to smscore_putbuffer() in smsusb_stop_streaming(), there is
no need to attempt to free urb->transfer_buffer by adding a
URB_FREE_BUFFER to urb transfer flags. As syzkaller shows, it triggers
a warning which will bring about proper crash on systems with
'panic_on_warn' set.

Therefore, skip the flag setting step to fix the issue. This change
was tested exclusively with syz-repros and KMEMLEAK sanitizer.

The idea for this patch was originally devised by Hillf Danton.

Suggested-by: Hillf Danton <hdanton@sina.com>
Reported-by: syzbot+b466336413a1fba398a5@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=b466336413a1fba398a5
Fixes: 564246fd3ff4 ("media: siano: Fix coherent memory allocation failure on arm64")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
---
 drivers/media/usb/siano/smsusb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index 2c8179a84991..a78b1c233aad 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -168,7 +168,6 @@ static int smsusb_submit_urb(struct smsusb_device_t *dev,
 		smsusb_onresponse,
 		surb
 	);
-	surb->urb->transfer_flags |= URB_FREE_BUFFER;
 
 	return usb_submit_urb(surb->urb, GFP_ATOMIC);
 }

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

end of thread, other threads:[~2025-06-09 10:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-22 14:00 [PATCH] media: usb: siano: do not free urb-specific transfer buffer Nikita Zhandarovich
2025-06-09 10:37 ` Nikita Zhandarovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®