Opened 8 months ago

Closed 7 months ago

#14752 closed bug (fixed)

KDL: SMAP violation in usb_disk

Reported by: Berusik Owned by: korli
Priority: normal Milestone: Unscheduled
Component: System/Kernel Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no 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 8 months ago.
0_IMG_20190117_210028.jpg (4.8 MB) - added by kallisti5 7 months ago.
hrev52775 XHCI dd

Change History (10)

Changed 8 months ago by Berusik

Attachment: IMG_20181211_161642.jpg added

comment:1 Changed 8 months ago by korli

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

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

comment:2 Changed 8 months ago by Berusik

52635

comment:3 Changed 8 months ago by waddlesplash

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 Changed 8 months ago by korli

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 Changed 8 months ago by waddlesplash

Summary: Kernel panicKDL: SMAP violation in usb_disk

comment:6 Changed 7 months ago by kallisti5

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)

Changed 7 months ago by kallisti5

Attachment: 0_IMG_20190117_210028.jpg added

hrev52775 XHCI dd

comment:7 Changed 7 months ago by waddlesplash

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 Changed 7 months ago by waddlesplash

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.