From: Greg Kroah-Hartman Date: Thu, 8 Jul 2021 15:36:37 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.4.275~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=39bd3a30cc6ed90f1bc48049937e3b0776e486c2;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: kfifo-declare_kifo_ptr-fifo-u64-does-not-work-on-arm-32-bit.patch --- diff --git a/queue-4.14/kfifo-declare_kifo_ptr-fifo-u64-does-not-work-on-arm-32-bit.patch b/queue-4.14/kfifo-declare_kifo_ptr-fifo-u64-does-not-work-on-arm-32-bit.patch new file mode 100644 index 00000000000..e6f53c3b804 --- /dev/null +++ b/queue-4.14/kfifo-declare_kifo_ptr-fifo-u64-does-not-work-on-arm-32-bit.patch @@ -0,0 +1,41 @@ +From 8a866fee3909c49738e1c4429a8d2b9bf27e015d Mon Sep 17 00:00:00 2001 +From: Sean Young +Date: Sun, 8 Oct 2017 12:12:16 -0400 +Subject: kfifo: DECLARE_KIFO_PTR(fifo, u64) does not work on arm 32 bit + +From: Sean Young + +commit 8a866fee3909c49738e1c4429a8d2b9bf27e015d upstream. + +If you try to store u64 in a kfifo (or a struct with u64 members), +then the buf member of __STRUCT_KFIFO_PTR will cause 4 bytes +padding due to alignment (note that struct __kfifo is 20 bytes +on 32 bit). + +That in turn causes the __is_kfifo_ptr() to fail, which is caught +by kfifo_alloc(), which now returns EINVAL. + +So, ensure that __is_kfifo_ptr() compares to the right structure. + +Signed-off-by: Sean Young +Acked-by: Stefani Seibold +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Matthew Weber +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/kfifo.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/include/linux/kfifo.h ++++ b/include/linux/kfifo.h +@@ -113,7 +113,8 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PT + * array is a part of the structure and the fifo type where the array is + * outside of the fifo structure. + */ +-#define __is_kfifo_ptr(fifo) (sizeof(*fifo) == sizeof(struct __kfifo)) ++#define __is_kfifo_ptr(fifo) \ ++ (sizeof(*fifo) == sizeof(STRUCT_KFIFO_PTR(typeof(*(fifo)->type)))) + + /** + * DECLARE_KFIFO_PTR - macro to declare a fifo pointer object diff --git a/queue-4.14/series b/queue-4.14/series index 7a57bd49bd2..6829ef67377 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -19,3 +19,4 @@ mm-thp-another-pvmw_sync-fix-in-page_vma_mapped_walk.patch mm-futex-fix-shared-futex-pgoff-on-shmem-huge-page.patch scsi-sr-return-appropriate-error-code-when-disk-is-e.patch drm-nouveau-fix-dma_address-check-for-cpu-gpu-sync.patch +kfifo-declare_kifo_ptr-fifo-u64-does-not-work-on-arm-32-bit.patch