Bug 217215 - Oops removing usb drive
Summary: Oops removing usb drive
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Default virtual assignee for Drivers/USB
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-19 16:04 UTC by Ed Tomlinson
Modified: 2023-03-20 13:52 UTC (History)
0 users

See Also:
Kernel Version: 6.2.7
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments

Description Ed Tomlinson 2023-03-19 16:04:40 UTC
Uinsg 6.2.7.arch1-1 on an up to date Arch install (with just the kernel from testing) I get and oops doing:

Insert a usb CF drive
(nothing mounted)
Remove the CR drive

Mar 19 11:51:07 grover kernel: usb 3-1.3: new high-speed USB device number 10 using xhci_hcd
Mar 19 11:51:07 grover kernel: usb 3-1.3: New USB device found, idVendor=090c, idProduct=1000, bcdDevice=11.00
Mar 19 11:51:07 grover kernel: usb 3-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 19 11:51:07 grover kernel: usb 3-1.3: Product: USB Flash Disk
Mar 19 11:51:07 grover kernel: usb 3-1.3: Manufacturer: General
Mar 19 11:51:07 grover kernel: usb 3-1.3: SerialNumber: 0332120100061752
Mar 19 11:51:07 grover kernel: usb-storage 3-1.3:1.0: USB Mass Storage device detected
Mar 19 11:51:07 grover kernel: scsi host8: usb-storage 3-1.3:1.0
Mar 19 11:51:07 grover mtp-probe[54416]: checking bus 3, device 10: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.3"
Mar 19 11:51:07 grover mtp-probe[54416]: bus: 3, device: 10 was not an MTP device
Mar 19 11:51:07 grover mtp-probe[54421]: checking bus 3, device 10: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.3"
Mar 19 11:51:07 grover mtp-probe[54421]: bus: 3, device: 10 was not an MTP device
Mar 19 11:51:08 grover kernel: scsi 8:0:0:0: Direct-Access     General  USB Flash Disk   1100 PQ: 0 ANSI: 4
Mar 19 11:51:08 grover kernel: sd 8:0:0:0: Attached scsi generic sg9 type 0
Mar 19 11:51:08 grover kernel: sd 8:0:0:0: [sdj] 15722496 512-byte logical blocks: (8.05 GB/7.50 GiB)
Mar 19 11:51:08 grover kernel: sd 8:0:0:0: [sdj] Write Protect is off
Mar 19 11:51:08 grover kernel: sd 8:0:0:0: [sdj] Mode Sense: 43 00 00 00
Mar 19 11:51:08 grover kernel: sd 8:0:0:0: [sdj] No Caching mode page found
Mar 19 11:51:08 grover kernel: sd 8:0:0:0: [sdj] Assuming drive cache: write through
Mar 19 11:51:08 grover kernel:  sdj: sdj1 sdj2
Mar 19 11:51:08 grover kernel: sd 8:0:0:0: [sdj] Attached SCSI removable disk
Mar 19 11:51:08 grover dbus-daemon[544]: [system] Activating service name='org.kde.kded.smart' requested by ':1.96' (uid=1000 pid=32581 comm="/usr/bin/kded5") (using servicehelper)
Mar 19 11:51:08 grover dbus-daemon[544]: [system] Successfully activated service 'org.kde.kded.smart'
Mar 19 11:51:52 grover kernel: usb 3-1.3: USB disconnect, device number 10
Mar 19 11:51:53 grover kernel: ------------[ cut here ]------------
Mar 19 11:51:53 grover kernel: remove_proc_entry: removing non-empty directory 'scsi/usb-storage', leaking at least '6'
Mar 19 11:51:53 grover kernel: WARNING: CPU: 5 PID: 44705 at fs/proc/generic.c:718 remove_proc_entry+0x199/0x1b0
Mar 19 11:51:53 grover kernel: Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq tls iptable_nat xt_MASQUERADE nf_nat wireguard curve25519_x86_64 libchacha20poly1305 chacha_x86_64 poly1305_x86_64 libcurve25519_generic libchacha ip6_udp_tunnel udp_tunnel snd_usb_audio snd_usbmidi_lib snd_rawmidi uvcvideo snd_seq_device hid_logitech_hidpp mousedev cmac algif_hash algif_skcipher af_alg bnep nct6775 nct6775_core hwmon_vid hid_logitech_dj joydev btusb btrtl btbcm btintel btmtk usbhid uas usb_storage nls_iso8859_1 vfat fat intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_hda_codec_realtek snd_hda_codec_generic irqbypass ip6t_REJECT ledtrig_audio nf_reject_ipv6 snd_hda_codec_hdmi crct10dif_pclmul crc32_pclmul snd_hda_intel polyval_clmulni polyval_generic snd_intel_dspcfg gf128mul snd_intel_sdw_acpi xt_hl snd_hda_codec ghash_clmulni_intel sha512_ssse3 ip6t_rt snd_hda_core aesni_intel snd_hwdep snd_pcm crypto_simd mei_hdcp cryptd mei_pxp at24 snd_timer
Mar 19 11:51:53 grover kernel:  ipt_REJECT rapl mei_me intel_cstate i2c_i801 nf_reject_ipv4 snd xt_recent cfg80211 intel_uncore e1000e mei pcspkr soundcore i2c_smbus xt_limit mac_hid xt_addrtype xt_tcpudp xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6table_filter ip6_tables iptable_filter xt_LOG nf_log_syslog ath3k bluetooth ecdh_generic rfkill gspca_pac7311 gspca_ov519 gspca_main videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videodev videobuf2_common mc acpi_power_meter acpi_pad acpi_ipmi ipmi_devintf ipmi_msghandler dm_multipath sg crypto_user fuse dm_mod loop bpf_preload ip_tables x_tables ext4 crc16 mbcache jbd2 serio_raw atkbd libps2 vivaldi_fmap xhci_pci i8042 xhci_pci_renesas serio gpio_exar 8250_exar amdgpu drm_ttm_helper ttm video wmi drm_buddy gpu_sched drm_display_helper cec btrfs blake2b_generic xor raid6_pq libcrc32c crc32c_generic crc32c_intel
Mar 19 11:51:53 grover kernel: CPU: 5 PID: 44705 Comm: kworker/5:2 Not tainted 6.2.7-arch1-1 #1 d0ef1d2ba4aa7f22be04df39dde66a4c3cc73dc4
Mar 19 11:51:53 grover kernel: Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./Z87E-ITX, BIOS P2.50 07/11/2014
Mar 19 11:51:53 grover kernel: Workqueue: usb_hub_wq hub_event
Mar 19 11:51:53 grover kernel: RIP: 0010:remove_proc_entry+0x199/0x1b0
Mar 19 11:51:53 grover kernel: Code: c7 38 48 44 9a 48 85 c0 48 8d 90 78 ff ff ff 48 0f 45 c2 48 8b 53 78 4c 8b 80 a0 00 00 00 48 8b 92 a0 00 00 00 e8 d7 25 c2 ff <0f> 0b e9 41 ff ff ff e8 bb cb 8a 00 66 66 2e 0f 1f 84 00 00 00 00
Mar 19 11:51:53 grover kernel: RSP: 0018:ffffa3eb63387b50 EFLAGS: 00010286
Mar 19 11:51:53 grover kernel: RAX: 0000000000000000 RBX: ffff8bc2d47f2840 RCX: 0000000000000027
Mar 19 11:51:53 grover kernel: RDX: ffff8bc5ced61648 RSI: 0000000000000001 RDI: ffff8bc5ced61640
Mar 19 11:51:53 grover kernel: RBP: ffff8bc2d47f28c0 R08: 0000000000000000 R09: ffffa3eb633879e0
Mar 19 11:51:53 grover kernel: R10: 0000000000000003 R11: ffffffff9acc9a68 R12: ffff8bc2c0eb2480
Mar 19 11:51:53 grover kernel: R13: ffff8bc2e3a948a0 R14: 0000000000000000 R15: ffff8bc409e03c30
Mar 19 11:51:53 grover kernel: FS:  0000000000000000(0000) GS:ffff8bc5ced40000(0000) knlGS:0000000000000000
Mar 19 11:51:53 grover kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Mar 19 11:51:53 grover kernel: CR2: 0000561b3bf07a18 CR3: 000000006a610001 CR4: 00000000001706e0
Mar 19 11:51:53 grover kernel: Call Trace:
Mar 19 11:51:53 grover kernel:  <TASK>
Mar 19 11:51:53 grover kernel:  scsi_proc_hostdir_rm+0x79/0xc0
Mar 19 11:51:53 grover kernel:  scsi_host_dev_release+0x3a/0xe0
Mar 19 11:51:53 grover kernel:  device_release+0x37/0x90
Mar 19 11:51:53 grover kernel:  kobject_put+0x8e/0x1d0
Mar 19 11:51:53 grover kernel:  usb_unbind_interface+0x93/0x270
Mar 19 11:51:53 grover kernel:  device_release_driver_internal+0x1b6/0x230
Mar 19 11:51:53 grover kernel:  bus_remove_device+0xdc/0x150
Mar 19 11:51:53 grover kernel:  device_del+0x18f/0x410
Mar 19 11:51:53 grover kernel:  ? kobject_put+0xa0/0x1d0
Mar 19 11:51:53 grover kernel:  usb_disable_device+0xbb/0x1e0
Mar 19 11:51:53 grover kernel:  usb_disconnect+0xe3/0x2d0
Mar 19 11:51:53 grover kernel:  hub_event+0xa39/0x1c60
Mar 19 11:51:53 grover kernel:  ? __schedule+0x3d0/0x12e0
Mar 19 11:51:53 grover kernel:  process_one_work+0x1c8/0x3c0
Mar 19 11:51:53 grover kernel:  worker_thread+0x51/0x390
Mar 19 11:51:53 grover kernel:  ? __pfx_worker_thread+0x10/0x10
Mar 19 11:51:53 grover kernel:  kthread+0xde/0x110
Mar 19 11:51:53 grover kernel:  ? __pfx_kthread+0x10/0x10
Mar 19 11:51:53 grover kernel:  ret_from_fork+0x2c/0x50
Mar 19 11:51:53 grover kernel:  </TASK>
Mar 19 11:51:53 grover kernel: ---[ end trace 0000000000000000 ]---
Comment 1 Alan Stern 2023-03-19 21:38:43 UTC
This has nothing to do with the USB subsystem.  It is a bug in the SCSI subsystem, presumably fixed by commit be03df3d4bfe ("scsi: core: Fix a procfs host directory removal regression").

I trust this commit will find its way into the next 6.2.stable release (even though it was not marked as such).
Comment 2 Ed Tomlinson 2023-03-19 23:43:11 UTC
Thanks for the feedback Alan,  I'll watch for the fix.

Note You need to log in before you can comment on or make changes to this bug.