Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#14752 closed bug (fixed)

KDL: SMAP violation in usb_disk

Reported by: Berusik Owned by: korli
Priority: normal Milestone: R1/beta2
Component: System/Kernel Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

after dd on foto kernel panic, and command on Terminal

Attachments (2)

IMG_20181211_161642.jpg (4.1 MB ) - added by Berusik 5 years ago.
0_IMG_20190117_210028.jpg (4.8 MB ) - added by kallisti5 5 years ago.
hrev52775 XHCI dd

Change History (11)

by Berusik, 5 years ago

Attachment: IMG_20181211_161642.jpg added

comment:1 by korli, 5 years ago

Component: - GeneralSystem/Kernel
Owner: changed from nobody to korli
Status: newassigned

Which revision? I'm unsure which component is at fault here.

comment:2 by Berusik, 5 years ago

52635

comment:3 by waddlesplash, 5 years ago

I'm unsure which component is at fault here.

It seems we have taken the convention of handling user buffers in the drivers themselves (personally I think doing it in common_user_io makes more sense), so then usb_disk would be the thing to change here.

comment:4 by korli, 5 years ago

In scsi_disk at least, this is done in a IORequest, which nicely handles VM operations when needed. Might also be a good idea to introduce the IOScheduler in usb_disk.

For this specific bug then, usb_disk needs a bounce buffer for any user I/O requests.

comment:5 by waddlesplash, 5 years ago

Summary: Kernel panicKDL: SMAP violation in usb_disk

comment:6 by kallisti5, 5 years ago

I was running over this, and found some interesting observations:

Haiku x86_64, hrev52726, UEFI booted. USB 2.0

dd if=haiku-nightly-anyboot.iso of=/dev/disk/usb/0/0/raw bs=2M

No problems.

Haiku x86_64, hrev52775, UEFI booted, USB 3.0

BFS on USB 3.0 flash drive mounted at /TEST/
dd if=/dev/zero of=/TEST/test status=progress oflag=direct

KDL. (uploading soon)

by kallisti5, 5 years ago

Attachment: 0_IMG_20190117_210028.jpg added

hrev52775 XHCI dd

comment:7 by waddlesplash, 5 years ago

Actually it seems the USB stack already handles userland areas: http://xref.plausible.coop/source/xref/haiku/src/add-ons/kernel/bus_managers/usb/Transfer.cpp#136

It just doesn't do it when the kernel passes buffers in. So, we should modify this code to accept user buffers from the kernel, too.

comment:8 by waddlesplash, 5 years ago

Resolution: fixed
Status: assignedclosed

It was actually a bug in XHCI itself. Fixed in hrev52826.

comment:9 by nielx, 4 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.