android_kernel_samsung_a7y1.../drivers
Horia Geantă 4f35da52b1 crypto: caam - fix concurrency issue in givencrypt descriptor
commit 48f89d2a2920166c35b1c0b69917dbb0390ebec7 upstream.

IV transfer from ofifo to class2 (set up at [29][30]) is not guaranteed
to be scheduled before the data transfer from ofifo to external memory
(set up at [38]:

[29] 10FA0004           ld: ind-nfifo (len=4) imm
[30] 81F00010               <nfifo_entry: ofifo->class2 type=msg len=16>
[31] 14820004           ld: ccb2-datasz len=4 offs=0 imm
[32] 00000010               data:0x00000010
[33] 8210010D    operation: cls1-op aes cbc init-final enc
[34] A8080B04         math: (seqin + math0)->vseqout len=4
[35] 28000010    seqfifold: skip len=16
[36] A8080A04         math: (seqin + math0)->vseqin len=4
[37] 2F1E0000    seqfifold: both msg1->2-last2-last1 len=vseqinsz
[38] 69300000   seqfifostr: msg len=vseqoutsz
[39] 5C20000C      seqstr: ccb2 ctx len=12 offs=0

If ofifo -> external memory transfer happens first, DECO will hang
(issuing a Watchdog Timeout error, if WDOG is enabled) waiting for
data availability in ofifo for the ofifo -> c2 ififo transfer.

Make sure IV transfer happens first by waiting for all CAAM internal
transfers to end before starting payload transfer.

New descriptor with jump command inserted at [37]:

[..]
[36] A8080A04         math: (seqin + math0)->vseqin len=4
[37] A1000401         jump: jsl1 all-match[!nfifopend] offset=[01] local->[38]
[38] 2F1E0000    seqfifold: both msg1->2-last2-last1 len=vseqinsz
[39] 69300000   seqfifostr: msg len=vseqoutsz
[40] 5C20000C      seqstr: ccb2 ctx len=12 offs=0

[Note: the issue is present in the descriptor from the very beginning
(cf. Fixes tag). However I've marked it v4.19+ since it's the oldest
maintained kernel that the patch applies clean against.]

Cc: <stable@vger.kernel.org> # v4.19+
Fixes: 1acebad3d8db8 ("crypto: caam - faster aead implementation")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[Horia: backport to v4.4, v4.9]
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 08:08:16 +02:00
..
accessibility A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
acpi ACPI: custom_method: fix memory leaks 2020-04-07 07:38:59 +02:00
amba A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
android ANDROID: binder: synchronize_rcu() when using POLLFREE. 2020-04-07 08:06:59 +02:00
ata libata: add SG safety checks in SFF pio transfers 2020-04-06 20:53:32 +02:00
atm Kconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICSTAR_USE_IDT77105 2020-04-06 21:36:26 +02:00
auxdisplay A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
base base: soc: Export soc_device_register/unregister APIs 2020-04-07 07:38:14 +02:00
battery A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
battery_v2 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bcma A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
block floppy: fix usercopy direction 2020-04-06 21:37:07 +02:00
bluetooth Bluetooth: btrtl: Additional Realtek 8822CE Bluetooth devices 2020-04-07 07:37:02 +02:00
bts A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bus A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ccic A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cdrom cdrom: Fix race condition in cdrom_sysctl_register 2020-04-06 14:51:44 +02:00
char ipmi_si: Only schedule continuously in the thread in maintenance mode 2020-04-07 07:42:51 +02:00
clk clk: sirf: Don't reference clk_init_data after registration 2020-04-07 07:42:56 +02:00
clocksource A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
connector A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cpufreq cpufreq/pasemi: fix use-after-free in pas_cpufreq_cpu_init() 2020-04-06 20:38:49 +02:00
cpuidle A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crypto crypto: caam - fix concurrency issue in givencrypt descriptor 2020-04-07 08:08:16 +02:00
dca A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
devfreq A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dio A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dma dmaengine: ti: edma: Do not reset reserved paRAM slots 2020-04-07 07:39:07 +02:00
dma-buf A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
edac EDAC: Fix global-out-of-bounds write when setting edac_mc_poll_msec 2020-04-06 19:55:33 +02:00
eisa A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extcon extcon: arizona: Disable mic detect if running when driver is removed 2020-04-06 18:19:23 +02:00
fingerprint A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
firewire A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
firmware efi: cper: print AER info of PCIe fatal error 2020-04-07 07:38:26 +02:00
five A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fmc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fpga A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
gator A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
gpio gpio: omap: ensure irq is enabled before wakeup 2020-04-06 19:54:51 +02:00
gps A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
gpu drm/amdgpu: Check for valid number of registers to read 2020-04-07 08:08:04 +02:00
gud A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid HID: apple: Fix stuck function keys when using FN 2020-04-07 07:43:36 +02:00
hsi A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hv A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hwmon hwmon: (acpi_power_meter) Change log level for 'unsafe software power cap' 2020-04-07 07:39:02 +02:00
hwspinlock A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hwtracing stm class: Fix a double free of stm_source_device 2020-04-06 21:33:50 +02:00
i2c i2c: riic: Clear NACK in tend isr 2020-04-07 07:41:06 +02:00
ide A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
idle A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iio iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data 2020-04-06 18:19:39 +02:00
infiniband IB/mlx4: Fix memory leaks 2020-04-06 21:34:25 +02:00
input Input: psmouse - fix build error of multiple definition 2020-04-06 20:50:06 +02:00
iommu iommu/amd: Move iommu_init_pci() to .init section 2020-04-06 20:50:24 +02:00
ipack A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
irqchip irqchip/gic-v3-its: Fix LPI release for Multi-MSI devices 2020-04-07 07:36:50 +02:00
isdn mISDN: enforce CAP_NET_RAW for raw sockets 2020-04-07 07:37:27 +02:00
leds leds: leds-lp5562 allow firmware files up to the maximum length 2020-04-07 07:37:48 +02:00
lguest A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lightnvm A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
macintosh A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mailbox mailbox: handle failed named mailbox channel request 2020-04-06 20:13:46 +02:00
mcb A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
md md/raid6: Set R5_ReadError when there is read failure on parity disk 2020-04-07 07:40:38 +02:00
media media: sn9c20x: Add MSI MS-1039 laptop to flip_dmi_table 2020-04-07 07:40:15 +02:00
memory memory: tegra: Fix integer overflow on tick value calculation 2020-04-06 18:14:02 +02:00
memstick memstick: Fix error cleanup path of memstick_init 2020-04-06 20:05:56 +02:00
message A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mfd mfd: intel-lpss: Remove D3cold delay 2020-04-07 07:43:26 +02:00
misc VMCI: Release resource if the work is already queued 2020-04-06 21:33:52 +02:00
mmc mmc: sdhci: Fix incorrect switch to HS mode 2020-04-07 07:39:15 +02:00
motor A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mtd mtd: cfi_cmdset_0002: Use chip_good() to retry in do_write_oneword() 2020-04-07 07:36:30 +02:00
muic A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
net ieee802154: atusb: fix use-after-free at disconnect 2020-04-07 08:07:50 +02:00
nfc st_nci_hci_connectivity_event_received: null check the allocation 2020-04-06 20:52:53 +02:00
ntb A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nubus A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nvdimm libnvdimm/btt: Fix a kmemdup failure check 2020-04-06 16:43:30 +02:00
nvme A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nvmem nvmem: core: fix read buffer in place 2020-04-06 19:02:03 +02:00
of A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
oprofile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
parisc parisc: Disable HP HSC-PCI Cards to prevent kernel crash 2020-04-07 07:39:52 +02:00
parport parport: Fix mem leak in parport_register_dev_model 2020-04-06 19:16:22 +02:00
pci PCI: sysfs: Ignore lockdep for remove attribute 2020-04-06 20:06:10 +02:00
pcmcia A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
perf A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
phy phy: renesas: rcar-gen2: Fix memory leak at error paths 2020-04-06 20:06:04 +02:00
pinctrl pinctrl: tegra: Fix write barrier placement in pmx_writel 2020-04-07 07:43:10 +02:00
platform platform/chrome: cros_ec_proto: check for NULL transfer function 2020-04-06 19:02:11 +02:00
pnp A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
power power: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUG 2020-04-06 18:14:39 +02:00
powercap A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pps drivers/pps/pps.c: clear offset flags in PPS_SETPARAMS ioctl 2020-04-06 20:26:27 +02:00
ps3 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ptp A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pwm pwm: Fix deadlock warning when removing PWM device 2020-04-06 19:02:42 +02:00
rapidio A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ras A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
regulator regulator: s2mps11: Fix buck7 and buck8 wrong voltages 2020-04-06 20:03:59 +02:00
remoteproc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
reset A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rpmsg A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rtc rtc: 88pm860x: prevent use-after-free on device remove 2020-04-06 18:15:42 +02:00
s390 s390/cio: exclude subchannels with no parent from pseudo check 2020-04-07 08:07:38 +02:00
sbus A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
scsi scsi: core: Reduce memory required for SCSI logging 2020-04-07 07:43:20 +02:00
security/samsung/icdrv A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sensorhub A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sensors A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sfi A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sh A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sn A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
soc soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipher 2020-04-06 19:02:13 +02:00
spi spi: bcm2835aux: fix corruptions for longer spi transfers 2020-04-06 21:34:39 +02:00
spmi A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ssb ssb: Fix possible NULL pointer dereference in ssb_host_pcmcia_exit 2020-04-06 18:15:20 +02:00
staging staging: comedi: dt3000: Fix rounding up of timer divisor 2020-04-06 20:49:26 +02:00
switch A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
target A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tee A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
thermal thermal: Fix use-after-free when unregistering thermal zone device 2020-04-07 08:08:06 +02:00
thunderbolt A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
trace A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tty tty/serial: atmel: reschedule TX after RX was started 2020-04-06 21:36:12 +02:00
uh A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
uio A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
usb USB: usbcore: Fix slab-out-of-bounds bug during device reset 2020-04-06 21:36:00 +02:00
uwb A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vfio vfio_pci: Restore original state on release 2020-04-07 07:43:13 +02:00
vhost vhost: make sure log_num < in_num 2020-04-06 21:35:05 +02:00
video video: ssd1307fb: Start page range at page_offset 2020-04-07 07:41:57 +02:00
virt drivers/virt/fsl_hypervisor.c: prevent integer overflow in ioctl 2020-04-06 17:01:49 +02:00
virtio A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vision A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vlynq A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vme A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
w1 w1: fix the resume command API 2020-04-06 18:15:45 +02:00
watchdog watchdog: bcm2835_wdt: Fix module autoload 2020-04-06 21:33:14 +02:00
xen xen/pci: reserve MCFG areas earlier 2020-04-07 08:08:00 +02:00
zorro A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30