Opened 3 years ago

Closed 3 years ago

#17283 closed bug (fixed)

SMAP violation on usb_disk

Reported by: Coldfirex Owned by: mmlr
Priority: normal Milestone: R1/beta4
Component: Drivers/Disk/USB Version: R1/beta3
Keywords: smap Cc:
Blocked By: Blocking:
Platform: All

Description

I plugged in a USB dvd drive to my laptop, inserted an audio CD, opened MediaPlayer (which auto-started a .wav file), I stopped the wav file from playing, and then hit Eject from the file menu. Got SMAP KPL.

Can reproduce. hrev55445

Attachments (1)

PXL_20210925_004621175.jpg (347.9 KB ) - added by Coldfirex 3 years ago.

Download all attachments as: .zip

Change History (9)

by Coldfirex, 3 years ago

Attachment: PXL_20210925_004621175.jpg added

comment:1 by korli, 3 years ago

Coldfirex, please see https://git.haiku-os.org/haiku/tree/src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp#n1802

basically it should be like: https://git.haiku-os.org/haiku/tree/src/add-ons/kernel/generic/scsi_periph/io.cpp#n406

			if (IS_USER_ADDRESS(buffer)) {
				if (user_memcpy(buffer, &ready, sizeof(status_t)) != B_OK)
					return B_BAD_ADDRESS;
			} else if (is_called_via_syscall()) {
				return B_BAD_ADDRESS;
			} else
				*(status_t *)buffer = ready;

comment:2 by korli, 3 years ago

Component: Drivers/USBDrivers/Disk/USB

comment:3 by Coldfirex, 3 years ago

Korli: Thanks for pointing out the area, but I will need to defer to someone else on making this change.

comment:4 by korli, 3 years ago

pushed a change to be tested: https://review.haiku-os.org/c/haiku/+/4505

Version 0, edited 3 years ago by korli (next)

comment:5 by Coldfirex, 3 years ago

Thanks! How do I test this?

in reply to:  5 comment:6 by korli, 3 years ago

Replying to Coldfirex:

Thanks! How do I test this?

Download the iso and boot on USB.

comment:7 by Coldfirex, 3 years ago

Fixed! And it actually ejects the usb disc drive with or without a disc inserted. :)

comment:8 by korli, 3 years ago

Milestone: UnscheduledR1/beta4
Resolution: fixed
Status: newclosed

Thanks for the test and feedback! Applied in hrev55480

Note: See TracTickets for help on using tickets.