From: Sasha Levin Date: Sun, 7 Mar 2021 23:08:23 +0000 (-0500) Subject: Fixes for 4.19 X-Git-Tag: v5.4.104~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de7846ec692e56ac5e961a53c6396b3d9a31dc8a;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/alsa-ctxfi-cthw20k2-fix-mask-on-conf-to-allow-4-bits.patch b/queue-4.19/alsa-ctxfi-cthw20k2-fix-mask-on-conf-to-allow-4-bits.patch new file mode 100644 index 00000000000..52e4f6f72e4 --- /dev/null +++ b/queue-4.19/alsa-ctxfi-cthw20k2-fix-mask-on-conf-to-allow-4-bits.patch @@ -0,0 +1,46 @@ +From ada8ad54df23c71ff16e28ce81ef7286b093b293 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 27 Feb 2021 00:15:27 +0000 +Subject: ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits + +From: Colin Ian King + +[ Upstream commit 26a9630c72ebac7c564db305a6aee54a8edde70e ] + +Currently the mask operation on variable conf is just 3 bits so +the switch statement case value of 8 is unreachable dead code. +The function daio_mgr_dao_init can be passed a 4 bit value, +function dao_rsc_init calls it with conf set to: + + conf = (desc->msr & 0x7) | (desc->passthru << 3); + +so clearly when desc->passthru is set to 1 then conf can be +at least 8. + +Fix this by changing the mask to 0xf. + +Fixes: 8cc72361481f ("ALSA: SB X-Fi driver merge") +Signed-off-by: Colin Ian King +Link: https://lore.kernel.org/r/20210227001527.1077484-1-colin.king@canonical.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/ctxfi/cthw20k2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c +index 3c966fafc754..6c9ab602212e 100644 +--- a/sound/pci/ctxfi/cthw20k2.c ++++ b/sound/pci/ctxfi/cthw20k2.c +@@ -995,7 +995,7 @@ static int daio_mgr_dao_init(void *blk, unsigned int idx, unsigned int conf) + + if (idx < 4) { + /* S/PDIF output */ +- switch ((conf & 0x7)) { ++ switch ((conf & 0xf)) { + case 1: + set_field(&ctl->txctl[idx], ATXCTL_NUC, 0); + break; +-- +2.30.1 + diff --git a/queue-4.19/rdma-rxe-fix-missing-kconfig-dependency-on-crypto.patch b/queue-4.19/rdma-rxe-fix-missing-kconfig-dependency-on-crypto.patch new file mode 100644 index 00000000000..e0af8b125e8 --- /dev/null +++ b/queue-4.19/rdma-rxe-fix-missing-kconfig-dependency-on-crypto.patch @@ -0,0 +1,44 @@ +From 83ed5e411e95a8a1e362e2ec6f2b66ecf1b9def0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Feb 2021 18:32:26 -0500 +Subject: RDMA/rxe: Fix missing kconfig dependency on CRYPTO + +From: Julian Braha + +[ Upstream commit 475f23b8c66d2892ad6acbf90ed757cafab13de7 ] + +When RDMA_RXE is enabled and CRYPTO is disabled, Kbuild gives the +following warning: + + WARNING: unmet direct dependencies detected for CRYPTO_CRC32 + Depends on [n]: CRYPTO [=n] + Selected by [y]: + - RDMA_RXE [=y] && (INFINIBAND_USER_ACCESS [=y] || !INFINIBAND_USER_ACCESS [=y]) && INET [=y] && PCI [=y] && INFINIBAND [=y] && INFINIBAND_VIRT_DMA [=y] + +This is because RDMA_RXE selects CRYPTO_CRC32, without depending on or +selecting CRYPTO, despite that config option being subordinate to CRYPTO. + +Fixes: cee2688e3cd6 ("IB/rxe: Offload CRC calculation when possible") +Signed-off-by: Julian Braha +Link: https://lore.kernel.org/r/21525878.NYvzQUHefP@ubuntu-mate-laptop +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/sw/rxe/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/infiniband/sw/rxe/Kconfig b/drivers/infiniband/sw/rxe/Kconfig +index 67ae960ab523..1fa19a77583e 100644 +--- a/drivers/infiniband/sw/rxe/Kconfig ++++ b/drivers/infiniband/sw/rxe/Kconfig +@@ -3,6 +3,7 @@ config RDMA_RXE + depends on INET && PCI && INFINIBAND + depends on !64BIT || ARCH_DMA_ADDR_T_64BIT + select NET_UDP_TUNNEL ++ select CRYPTO + select CRYPTO_CRC32 + select DMA_VIRT_OPS + ---help--- +-- +2.30.1 + diff --git a/queue-4.19/rsxx-return-efault-if-copy_to_user-fails.patch b/queue-4.19/rsxx-return-efault-if-copy_to_user-fails.patch new file mode 100644 index 00000000000..0ad7d572ecf --- /dev/null +++ b/queue-4.19/rsxx-return-efault-if-copy_to_user-fails.patch @@ -0,0 +1,50 @@ +From 2fa1d7f2ce3cf358f01aed3043d2c325aa9167e7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 Mar 2021 13:59:12 +0300 +Subject: rsxx: Return -EFAULT if copy_to_user() fails + +From: Dan Carpenter + +[ Upstream commit 77516d25f54912a7baedeeac1b1b828b6f285152 ] + +The copy_to_user() function returns the number of bytes remaining but +we want to return -EFAULT to the user if it can't complete the copy. +The "st" variable only holds zero on success or negative error codes on +failure so the type should be int. + +Fixes: 36f988e978f8 ("rsxx: Adding in debugfs entries.") +Signed-off-by: Dan Carpenter +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/block/rsxx/core.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c +index 14056dc45064..d8ef8b16fb2e 100644 +--- a/drivers/block/rsxx/core.c ++++ b/drivers/block/rsxx/core.c +@@ -179,15 +179,17 @@ static ssize_t rsxx_cram_read(struct file *fp, char __user *ubuf, + { + struct rsxx_cardinfo *card = file_inode(fp)->i_private; + char *buf; +- ssize_t st; ++ int st; + + buf = kzalloc(cnt, GFP_KERNEL); + if (!buf) + return -ENOMEM; + + st = rsxx_creg_read(card, CREG_ADD_CRAM + (u32)*ppos, cnt, buf, 1); +- if (!st) +- st = copy_to_user(ubuf, buf, cnt); ++ if (!st) { ++ if (copy_to_user(ubuf, buf, cnt)) ++ st = -EFAULT; ++ } + kfree(buf); + if (st) + return st; +-- +2.30.1 + diff --git a/queue-4.19/series b/queue-4.19/series index 13983817132..45f8c6ad3d1 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -13,3 +13,6 @@ nvme-register-ns_id-attributes-as-default-sysfs-groups.patch aoe-register-default-groups-with-device_add_disk.patch zram-register-default-groups-with-device_add_disk.patch virtio-blk-modernize-sysfs-attribute-creation.patch +alsa-ctxfi-cthw20k2-fix-mask-on-conf-to-allow-4-bits.patch +rdma-rxe-fix-missing-kconfig-dependency-on-crypto.patch +rsxx-return-efault-if-copy_to_user-fails.patch