Revision bbdc74dc19e09ac4e71bfb219596b3d5bc786720 authored by Grzegorz Sluja on 13 July 2017, 09:17:58 UTC, committed by Ulf Hansson on 13 July 2017, 09:44:01 UTC
The commit 304419d8a7e9 ("mmc: core: Allocate per-request data using the
block layer core"), refactored the mechanism of queue handling, but also
made mmc_init_request() to be called after mmc_cleanup_queue(). This
triggers a null pointer dereference:

[  683.123791] BUG: unable to handle kernel NULL pointer dereference at (null)
[  683.123801] IP: mmc_init_request+0x2c/0xf0 [mmc_block]
...
[  683.123905] Call Trace:
[  683.123913]  alloc_request_size+0x4f/0x70
[  683.123919]  mempool_alloc+0x5f/0x150
[  683.123925]  ? __enqueue_entity+0x6c/0x70
[  683.123928]  get_request+0x3ad/0x720
[  683.123933]  ? prepare_to_wait_event+0x110/0x110
[  683.123937]  blk_queue_bio+0xc1/0x3a0
[  683.123940]  generic_make_request+0xf8/0x2a0
[  683.123942]  submit_bio+0x75/0x150
[  683.123947]  submit_bio_wait+0x51/0x70
[  683.123951]  blkdev_issue_flush+0x5c/0x90
[  683.123956]  ext4_sync_fs+0x171/0x1b0
[  683.123961]  sync_filesystem+0x73/0x90
[  683.123965]  fsync_bdev+0x24/0x50
[  683.123971]  invalidate_partition+0x24/0x50
[  683.123973]  del_gendisk+0xb2/0x2a0
[  683.123977]  mmc_blk_remove_req.part.38+0x71/0xa0 [mmc_block]
[  683.123980]  mmc_blk_remove+0xba/0x190 [mmc_block]
[  683.123990]  mmc_bus_remove+0x1a/0x20 [mmc_core]
[  683.123995]  device_release_driver_internal+0x141/0x200
[  683.123999]  device_release_driver+0x12/0x20
[  683.124001]  bus_remove_device+0xfd/0x170
[  683.124004]  device_del+0x1e8/0x330
[  683.124012]  mmc_remove_card+0x60/0xc0 [mmc_core]
[  683.124019]  mmc_remove+0x19/0x30 [mmc_core]
[  683.124025]  mmc_stop_host+0xfb/0x1a0 [mmc_core]
[  683.124032]  mmc_remove_host+0x1a/0x40 [mmc_core]
[  683.124037]  sdhci_remove_host+0x2e/0x1c0 [mmc_sdhci]
[  683.124042]  sdhci_pci_remove_slot+0x3f/0x80 [sdhci_pci]
[  683.124045]  sdhci_pci_remove+0x39/0x70 [sdhci_pci]
[  683.124049]  pci_device_remove+0x39/0xc0
[  683.124052]  device_release_driver_internal+0x141/0x200
[  683.124056]  driver_detach+0x3f/0x80
[  683.124059]  bus_remove_driver+0x55/0xd0
[  683.124062]  driver_unregister+0x2c/0x50
[  683.124065]  pci_unregister_driver+0x29/0x90
[  683.124069]  sdhci_driver_exit+0x10/0x4f3 [sdhci_pci]
[  683.124073]  SyS_delete_module+0x171/0x250
[  683.124078]  entry_SYSCALL_64_fastpath+0x1e/0xa9

Fix this by setting the queue DYING flag before cleanup the queue, as it
prevents new reqs from entering the queue.

Signed-off-by: Grzegorz Sluja <grzegorzx.sluja@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Fixes: 304419d8a7e9 ("mmc: core: Allocate per-request data using the...")
[Ulf: Updated the changelog]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent aab2ee0
History
File Mode Size
ac97_codec.h -rw-r--r-- 28.4 KB
aci.h -rw-r--r-- 2.4 KB
ad1816a.h -rw-r--r-- 5.4 KB
ad1843.h -rw-r--r-- 1.5 KB
adau1373.h -rw-r--r-- 699 bytes
aess.h -rw-r--r-- 1.6 KB
ak4113.h -rw-r--r-- 10.9 KB
ak4114.h -rw-r--r-- 10.2 KB
ak4117.h -rw-r--r-- 9.0 KB
ak4531_codec.h -rw-r--r-- 3.1 KB
ak4641.h -rw-r--r-- 622 bytes
ak4xxx-adda.h -rw-r--r-- 3.3 KB
alc5623.h -rw-r--r-- 497 bytes
asequencer.h -rw-r--r-- 3.6 KB
asound.h -rw-r--r-- 1.3 KB
asoundef.h -rw-r--r-- 16.7 KB
atmel-abdac.h -rw-r--r-- 639 bytes
atmel-ac97c.h -rw-r--r-- 1.3 KB
compress_driver.h -rw-r--r-- 6.6 KB
control.h -rw-r--r-- 8.5 KB
core.h -rw-r--r-- 13.9 KB
cs35l33.h -rw-r--r-- 1.0 KB
cs35l34.h -rw-r--r-- 887 bytes
cs35l35.h -rw-r--r-- 2.4 KB
cs4231-regs.h -rw-r--r-- 8.3 KB
cs4271.h -rw-r--r-- 1.4 KB
cs42l52.h -rw-r--r-- 738 bytes
cs42l56.h -rw-r--r-- 1.2 KB
cs42l73.h -rw-r--r-- 507 bytes
cs8403.h -rw-r--r-- 8.6 KB
cs8427.h -rw-r--r-- 10.4 KB
da7213.h -rw-r--r-- 1.2 KB
da7218.h -rw-r--r-- 2.6 KB
da7219-aad.h -rw-r--r-- 2.4 KB
da7219.h -rw-r--r-- 1.0 KB
da9055.h -rw-r--r-- 914 bytes
designware_i2s.h -rw-r--r-- 2.2 KB
dmaengine_pcm.h -rw-r--r-- 6.2 KB
emu10k1.h -rw-r--r-- 89.3 KB
emu10k1_synth.h -rw-r--r-- 1.3 KB
emu8000.h -rw-r--r-- 4.0 KB
emu8000_reg.h -rw-r--r-- 10.2 KB
emux_legacy.h -rw-r--r-- 5.4 KB
emux_synth.h -rw-r--r-- 7.5 KB
es1688.h -rw-r--r-- 3.5 KB
gus.h -rw-r--r-- 20.2 KB
hda_chmap.h -rw-r--r-- 2.6 KB
hda_hwdep.h -rw-r--r-- 1.4 KB
hda_i915.h -rw-r--r-- 1.6 KB
hda_register.h -rw-r--r-- 10.0 KB
hda_regmap.h -rw-r--r-- 6.6 KB
hda_verbs.h -rw-r--r-- 16.7 KB
hdaudio.h -rw-r--r-- 18.4 KB
hdaudio_ext.h -rw-r--r-- 7.0 KB
hdmi-codec.h -rw-r--r-- 2.4 KB
hwdep.h -rw-r--r-- 2.6 KB
i2c.h -rw-r--r-- 3.5 KB
info.h -rw-r--r-- 7.4 KB
initval.h -rw-r--r-- 3.1 KB
jack.h -rw-r--r-- 3.7 KB
l3.h -rw-r--r-- 485 bytes
max9768.h -rw-r--r-- 729 bytes
max98088.h -rw-r--r-- 1.3 KB
max98090.h -rw-r--r-- 754 bytes
max98095.h -rw-r--r-- 1.5 KB
memalloc.h -rw-r--r-- 4.4 KB
minors.h -rw-r--r-- 4.3 KB
mixer_oss.h -rw-r--r-- 2.4 KB
mpu401.h -rw-r--r-- 4.5 KB
omap-hdmi-audio.h -rw-r--r-- 1.3 KB
omap-pcm.h -rw-r--r-- 864 bytes
opl3.h -rw-r--r-- 12.3 KB
opl4.h -rw-r--r-- 1.1 KB
pcm-indirect.h -rw-r--r-- 5.7 KB
pcm.h -rw-r--r-- 47.4 KB
pcm_drm_eld.h -rw-r--r-- 144 bytes
pcm_iec958.h -rw-r--r-- 293 bytes
pcm_oss.h -rw-r--r-- 2.6 KB
pcm_params.h -rw-r--r-- 9.0 KB
pt2258.h -rw-r--r-- 1.2 KB
pxa2xx-lib.h -rw-r--r-- 1.5 KB
rawmidi.h -rw-r--r-- 6.1 KB
rt286.h -rw-r--r-- 460 bytes
rt298.h -rw-r--r-- 519 bytes
rt5514.h -rw-r--r-- 478 bytes
rt5640.h -rw-r--r-- 648 bytes
rt5645.h -rw-r--r-- 738 bytes
rt5651.h -rw-r--r-- 468 bytes
rt5659.h -rw-r--r-- 1003 bytes
rt5660.h -rw-r--r-- 724 bytes
rt5665.h -rw-r--r-- 907 bytes
rt5670.h -rw-r--r-- 652 bytes
rt5677.h -rw-r--r-- 1.1 KB
s3c24xx_uda134x.h -rw-r--r-- 190 bytes
sb.h -rw-r--r-- 11.0 KB
sb16_csp.h -rw-r--r-- 2.7 KB
seq_device.h -rw-r--r-- 2.8 KB
seq_kernel.h -rw-r--r-- 3.9 KB
seq_midi_emul.h -rw-r--r-- 7.3 KB
seq_midi_event.h -rw-r--r-- 2.2 KB
seq_oss.h -rw-r--r-- 2.9 KB
seq_oss_legacy.h -rw-r--r-- 1.0 KB
seq_virmidi.h -rw-r--r-- 2.7 KB
sh_dac_audio.h -rw-r--r-- 587 bytes
sh_fsi.h -rw-r--r-- 847 bytes
simple_card.h -rw-r--r-- 683 bytes
simple_card_utils.h -rw-r--r-- 3.9 KB
snd_wavefront.h -rw-r--r-- 5.5 KB
soc-dai.h -rw-r--r-- 11.1 KB
soc-dapm.h -rw-r--r-- 30.7 KB
soc-dpcm.h -rw-r--r-- 4.7 KB
soc-topology.h -rw-r--r-- 5.7 KB
soc.h -rw-r--r-- 58.8 KB
soundfont.h -rw-r--r-- 4.5 KB
spear_dma.h -rw-r--r-- 1003 bytes
spear_spdif.h -rw-r--r-- 1010 bytes
sta32x.h -rw-r--r-- 1.2 KB
sta350.h -rw-r--r-- 1.6 KB
tas2552-plat.h -rw-r--r-- 678 bytes
tas5086.h -rw-r--r-- 171 bytes
tea6330t.h -rw-r--r-- 1.1 KB
timer.h -rw-r--r-- 5.4 KB
tlv.h -rw-r--r-- 2.3 KB
tlv320aic32x4.h -rw-r--r-- 900 bytes
tlv320aic3x.h -rw-r--r-- 1.9 KB
tlv320dac33-plat.h -rw-r--r-- 720 bytes
tpa6130a2-plat.h -rw-r--r-- 900 bytes
uda134x.h -rw-r--r-- 597 bytes
uda1380.h -rw-r--r-- 481 bytes
util_mem.h -rw-r--r-- 2.3 KB
vx_core.h -rw-r--r-- 15.3 KB
wavefront.h -rw-r--r-- 18.8 KB
wm0010.h -rw-r--r-- 679 bytes
wm1250-ev1.h -rw-r--r-- 656 bytes
wm2000.h -rw-r--r-- 625 bytes
wm2200.h -rw-r--r-- 1.5 KB
wm5100.h -rw-r--r-- 1.2 KB
wm8903.h -rw-r--r-- 15.2 KB
wm8904.h -rw-r--r-- 7.4 KB
wm8955.h -rw-r--r-- 662 bytes
wm8960.h -rw-r--r-- 603 bytes
wm8962.h -rw-r--r-- 1.8 KB
wm8993.h -rw-r--r-- 1.2 KB
wm8996.h -rw-r--r-- 1.4 KB
wm9081.h -rw-r--r-- 661 bytes
wm9090.h -rw-r--r-- 780 bytes
wss.h -rw-r--r-- 8.4 KB

back to top