linux-stable/drivers
Ondrej Mosnacek 9f830cf2d5 crypto: vmx - Fix sleep-in-atomic bugs
commit 0522236d4f upstream.

This patch fixes sleep-in-atomic bugs in AES-CBC and AES-XTS VMX
implementations. The problem is that the blkcipher_* functions should
not be called in atomic context.

The bugs can be reproduced via the AF_ALG interface by trying to
encrypt/decrypt sufficiently large buffers (at least 64 KiB) using the
VMX implementations of 'cbc(aes)' or 'xts(aes)'. Such operations then
trigger BUG in crypto_yield():

[  891.863680] BUG: sleeping function called from invalid context at include/crypto/algapi.h:424
[  891.864622] in_atomic(): 1, irqs_disabled(): 0, pid: 12347, name: kcapi-enc
[  891.864739] 1 lock held by kcapi-enc/12347:
[  891.864811]  #0: 00000000f5d42c46 (sk_lock-AF_ALG){+.+.}, at: skcipher_recvmsg+0x50/0x530
[  891.865076] CPU: 5 PID: 12347 Comm: kcapi-enc Not tainted 4.19.0-0.rc0.git3.1.fc30.ppc64le #1
[  891.865251] Call Trace:
[  891.865340] [c0000003387578c0] [c000000000d67ea4] dump_stack+0xe8/0x164 (unreliable)
[  891.865511] [c000000338757910] [c000000000172a58] ___might_sleep+0x2f8/0x310
[  891.865679] [c000000338757990] [c0000000006bff74] blkcipher_walk_done+0x374/0x4a0
[  891.865825] [c0000003387579e0] [d000000007e73e70] p8_aes_cbc_encrypt+0x1c8/0x260 [vmx_crypto]
[  891.865993] [c000000338757ad0] [c0000000006c0ee0] skcipher_encrypt_blkcipher+0x60/0x80
[  891.866128] [c000000338757b10] [c0000000006ec504] skcipher_recvmsg+0x424/0x530
[  891.866283] [c000000338757bd0] [c000000000b00654] sock_recvmsg+0x74/0xa0
[  891.866403] [c000000338757c10] [c000000000b00f64] ___sys_recvmsg+0xf4/0x2f0
[  891.866515] [c000000338757d90] [c000000000b02bb8] __sys_recvmsg+0x68/0xe0
[  891.866631] [c000000338757e30] [c00000000000bbe4] system_call+0x5c/0x70

Fixes: 8c755ace35 ("crypto: vmx - Adding CBC routines for VMX module")
Fixes: c07f5d3da6 ("crypto: vmx - Adding support for XTS")
Cc: stable@vger.kernel.org
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-09 19:56:01 +02:00
..
accessibility
acpi ACPI / EC: Use ec_no_wakeup on more Thinkpad X1 Carbon 6th systems 2018-08-24 13:09:20 +02:00
amba
android
ata libahci: Fix possible Spectre-v1 pmp indexing in ahci_led_store() 2018-08-24 13:09:00 +02:00
atm atm: zatm: Fix potential Spectre v1 2018-07-22 14:28:43 +02:00
auxdisplay auxdisplay: fix broken menu 2018-07-03 11:24:56 +02:00
base PM / clk: signedness bug in of_pm_clk_add_clks() 2018-09-05 09:26:42 +02:00
bcma
block drivers/block/zram/zram_drv.c: fix bug storing backing_dev 2018-09-09 19:55:58 +02:00
bluetooth Bluetooth: hci_serdev: Init hci_uart proto_lock to avoid oops 2018-08-15 18:12:49 +02:00
bus drivers/perf: arm-ccn: don't log to dmesg in event_init 2018-08-03 07:50:31 +02:00
cdrom cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status 2018-09-05 09:26:42 +02:00
char tpm: Return the actual size when receiving an unsupported command 2018-09-05 09:26:41 +02:00
clk clk: rockchip: fix clk_i2sout parent selection bits on rk3399 2018-09-05 09:26:42 +02:00
clocksource clocksource/drivers/imx-tpm: Correct some registers operation flow 2018-06-21 04:02:40 +09:00
connector
cpufreq cpufreq: governor: Avoid accessing invalid governor_data 2018-09-09 19:55:58 +02:00
cpuidle cpuidle: powernv: Fix promotion from snooze if next state disabled 2018-07-03 11:24:51 +02:00
crypto crypto: vmx - Fix sleep-in-atomic bugs 2018-09-09 19:56:01 +02:00
dax dev-dax: check_vma: ratelimit dev_info-s 2018-08-24 13:09:08 +02:00
dca
devfreq
dio
dma dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate() 2018-08-24 13:09:08 +02:00
dma-buf dma-buf: remove redundant initialization of sg_table 2018-06-05 11:41:57 +02:00
edac EDAC: Add missing MEM_LRDDR4 entry in edac_mem_types[] 2018-08-24 13:08:55 +02:00
eisa
extcon extcon: Release locking when sending the notification of connector state 2018-09-09 19:55:56 +02:00
firewire
firmware fw_cfg: fix driver remove 2018-08-17 21:01:11 +02:00
fmc
fpga
fsi
gpio gpiolib-acpi: make sure we trigger edge events at least once on boot 2018-09-05 09:26:32 +02:00
gpu drm/i915/userptr: reject zero user_size 2018-09-09 19:55:53 +02:00
hid HID: wacom: Correct touch maximum XY of 2nd-gen Intuos 2018-08-24 13:09:11 +02:00
hsi
hv Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind() 2018-09-09 19:55:56 +02:00
hwmon hwmon: (nct6775) Fix potential Spectre v1 2018-09-05 09:26:40 +02:00
hwspinlock
hwtracing intel_th: Use correct device when freeing buffers 2018-06-05 11:41:59 +02:00
i2c i2c/mux, locking/core: Annotate the nested rt_mutex usage 2018-09-05 09:26:29 +02:00
ide cdrom: do not call check_disk_change() inside cdrom_open() 2018-05-30 07:52:34 +02:00
idle intel_idle: Graceful probe failure when MWAIT is disabled 2018-08-09 12:16:39 +02:00
iio iio: ad9523: Fix return value for ad952x_store() 2018-09-09 19:55:56 +02:00
infiniband RDMA/rxe: Set wqe->status correctly if an unexpected response is received 2018-09-09 19:55:54 +02:00
input Input: synaptics-rmi4 - fix axis-swap behavior 2018-08-24 13:08:56 +02:00
iommu iommu/vt-d: Fix dev iotlb pfsid use 2018-09-09 19:56:00 +02:00
ipack
irqchip irqchip/ls-scfg-msi: Map MSIs in the iommu 2018-08-03 07:50:24 +02:00
isdn isdn: Disable IIOCDBGVAR 2018-08-22 07:46:11 +02:00
leds
lightnvm lightnvm: pblk: warn in case of corrupted write buffer 2018-08-03 07:50:25 +02:00
macintosh drivers: macintosh: rack-meter: really fix bogus memsets 2018-05-30 07:52:27 +02:00
mailbox mailbox: xgene-slimpro: Fix potential NULL pointer dereference 2018-09-09 19:55:54 +02:00
mcb
md bcache: release dc->writeback_lock properly in bch_writeback_thread() 2018-09-09 19:56:01 +02:00
media media: Revert "[media] tvp5150: fix pad format frame height" 2018-09-09 19:55:53 +02:00
memory memory: tegra: Apply interrupts mask per SoC 2018-08-03 07:50:38 +02:00
memstick
message scsi: mptfusion: Add bounds check in mptctl_hp_targetinfo() 2018-05-25 16:17:47 +02:00
mfd mfd: hi655x: Fix regmap area declared size for hi655x 2018-09-09 19:55:58 +02:00
misc vmw_balloon: fix VMCI use when balloon built into kernel 2018-09-09 19:55:57 +02:00
mmc mmc: renesas_sdhi_internal_dmac: fix #define RST_RESERVED_BITS 2018-09-09 19:55:53 +02:00
mtd mtd: dataflash: Use ULL suffix for 64-bit constants 2018-08-24 13:09:04 +02:00
mux
net libertas: fix suspend and resume for SDIO connected cards 2018-09-09 19:55:53 +02:00
nfc NFC: pn533: Fix wrong GFP flag usage 2018-08-24 13:09:06 +02:00
ntb
nubus
nvdimm libnvdimm: fix ars_status output length calculation 2018-09-09 19:56:01 +02:00
nvme nvme-pci: add a memory barrier to nvme_dbbuf_update_and_check_event 2018-09-05 09:26:36 +02:00
nvmem nvmem: Don't let a NULL cell_id for nvmem_cell_get() crash us 2018-08-24 13:09:14 +02:00
of of: platform: stop accessing invalid dev in of_platform_device_destroy 2018-07-03 11:24:52 +02:00
oprofile
parisc parisc/pci: Switch LBA PCI bus from Hard Fail to Soft Fail mode 2018-05-30 07:52:28 +02:00
parport
pci PCI: pciehp: Fix unprotected list iteration in IRQ handler 2018-08-24 13:09:23 +02:00
pcmcia PCMCIA / PM: Avoid noirq suspend aborts during suspend-to-idle 2018-05-30 07:52:39 +02:00
perf drivers/perf: xgene_pmu: Fix IOB SLOW PMU parser error 2018-08-24 13:08:59 +02:00
phy phy: phy-mtk-tphy: use auto instead of force to bypass utmi signals 2018-08-15 18:12:48 +02:00
pinctrl pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show() 2018-09-05 09:26:39 +02:00
platform platform/x86: ideapad-laptop: Apply no_hw_rfkill to Y20-15IKBM, too 2018-09-05 09:26:36 +02:00
pnp
power power: generic-adc-battery: check for duplicate properties copied from iio channels 2018-09-05 09:26:42 +02:00
powercap
pps
ps3
ptp ptp: fix missing break in switch 2018-07-25 11:25:10 +02:00
pwm pwm: tiehrpwm: Fix disabling of output of PWMs 2018-09-09 19:56:00 +02:00
rapidio
ras
regulator regulator: Don't return or expect -errno from of_map_mode() 2018-08-03 07:50:40 +02:00
remoteproc remoteproc: qcom: Fix potential device node leaks 2018-06-21 04:02:48 +09:00
reset
rpmsg rpmsg: smd: do not use mananged resources for endpoints and channels 2018-07-03 11:24:59 +02:00
rtc rtc: omap: fix potential crash on power off 2018-09-09 19:55:57 +02:00
s390 s390/qdio: reset old sbal_state flags 2018-09-05 09:26:40 +02:00
sbus
scsi scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock 2018-09-05 09:26:41 +02:00
sfi
sh
sn
soc soc: imx: gpc: restrict register range for regmap access 2018-08-24 13:09:19 +02:00
spi spi: cadence: Change usleep_range() to udelay(), for atomic context 2018-09-09 19:55:53 +02:00
spmi
ssb
staging media: staging: omap4iss: Include asm/cacheflush.h after generic includes 2018-09-05 09:26:28 +02:00
target iscsi target: fix session creation failure handling 2018-09-05 09:26:41 +02:00
tc
tee tee: check shm references are consistent in offset/size 2018-06-21 04:02:54 +09:00
thermal thermal: exynos: fix setting rising_threshold for Exynos5433 2018-08-03 07:50:37 +02:00
thunderbolt
tty uart: fix race between uart_put_char() and uart_shutdown() 2018-09-09 19:55:56 +02:00
uio
usb usb: gadget: f_uac2: fix endianness of 'struct cntrl_*_lay3' 2018-09-05 09:26:26 +02:00
uwb
vfio vfio/type1: Fix task tracking for QEMU vCPU hotplug 2018-08-03 07:50:23 +02:00
vhost vhost: reset metadata cache when initializing new IOTLB 2018-08-22 07:46:09 +02:00
video fb: fix lost console when the user unplugs a USB adapter 2018-09-09 19:56:01 +02:00
virt
virtio virtio_balloon: fix another race between migration and ballooning 2018-08-06 16:20:49 +02:00
vlynq
vme
w1 1wire: family module autoload fails because of upper/lower case mismatch. 2018-07-03 11:24:47 +02:00
watchdog watchdog: da9063: Fix updating timeout value 2018-08-03 07:50:24 +02:00
xen xen/scsiback: add error handling for xenbus_printf 2018-08-24 13:09:01 +02:00
zorro zorro: Set up z->dev.dma_mask for the DMA API 2018-05-30 07:52:30 +02:00
Kconfig
Makefile