diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-28 15:09:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-28 15:09:44 +0200 |
commit | 42e4dab3dbfbf82344ceacacdc039d79feca67a5 (patch) | |
tree | a2aa74ecd397fbf9fadd14532ad5c3fda034a8ab | |
parent | da8e19abe98d4e2e9c16e1eb508dd059c440bf0a (diff) | |
download | patches-42e4dab3dbfbf82344ceacacdc039d79feca67a5.tar.gz |
add new patch and remove ones merged
21 files changed, 178 insertions, 299 deletions
diff --git a/0001-USB-iowarrior-fix-up-report-size-handling-for-some-d.patch b/0001-USB-iowarrior-fix-up-report-size-handling-for-some-d.patch deleted file mode 100644 index 0a030978716d4f..00000000000000 --- a/0001-USB-iowarrior-fix-up-report-size-handling-for-some-d.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 9f2f3f81bd9e9d4bd12202b765e1dbd964b4bbac Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -Date: Sun, 26 Jul 2020 11:45:33 +0200 -Subject: [PATCH] USB: iowarrior: fix up report size handling for some devices - -In previous patches that added support for new iowarrior devices, the -handling of the report size was not done correct. - -Fix that up and update the copyright date for the driver - -Reworked from an original patch written by Christoph Jung. - -Fixes: bab5417f5f01 ("USB: misc: iowarrior: add support for the 100 device") -Fixes: 5f6f8da2d7b5 ("USB: misc: iowarrior: add support for the 28 and 28L devices") -Fixes: 461d8deb26a7 ("USB: misc: iowarrior: add support for 2 OEMed devices") -Cc: stable <stable@kernel.org> -Reported-by: Christoph Jung <jung@codemercs.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - drivers/usb/misc/iowarrior.c | 35 +++++++++++++++++++++++++---------- - 1 file changed, 25 insertions(+), 10 deletions(-) - ---- a/drivers/usb/misc/iowarrior.c -+++ b/drivers/usb/misc/iowarrior.c -@@ -2,8 +2,9 @@ - /* - * Native support for the I/O-Warrior USB devices - * -- * Copyright (c) 2003-2005 Code Mercenaries GmbH -- * written by Christian Lucht <lucht@codemercs.com> -+ * Copyright (c) 2003-2005, 2020 Code Mercenaries GmbH -+ * written by Christian Lucht <lucht@codemercs.com> and -+ * Christoph Jung <jung@codemercs.com> - * - * based on - -@@ -802,14 +803,28 @@ static int iowarrior_probe(struct usb_in - - /* we have to check the report_size often, so remember it in the endianness suitable for our machine */ - dev->report_size = usb_endpoint_maxp(dev->int_in_endpoint); -- if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) && -- ((dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW56) || -- (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW56AM) || -- (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW28) || -- (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW28L) || -- (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW100))) -- /* IOWarrior56 has wMaxPacketSize different from report size */ -- dev->report_size = 7; -+ -+ /* -+ * Some devices need the report size to be different than the -+ * endpoint size. -+ */ -+ if (dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) { -+ switch (dev->product_id) { -+ case USB_DEVICE_ID_CODEMERCS_IOW56: -+ case USB_DEVICE_ID_CODEMERCS_IOW56AM: -+ dev->report_size = 7; -+ break; -+ -+ case USB_DEVICE_ID_CODEMERCS_IOW28: -+ case USB_DEVICE_ID_CODEMERCS_IOW28L: -+ dev->report_size = 4; -+ break; -+ -+ case USB_DEVICE_ID_CODEMERCS_IOW100: -+ dev->report_size = 13; -+ break; -+ } -+ } - - /* create the urb and buffer for reading */ - dev->int_in_urb = usb_alloc_urb(0, GFP_KERNEL); diff --git a/0001-mtd-properly-check-all-write-ioctls-for-permissions.patch b/0001-mtd-properly-check-all-write-ioctls-for-permissions.patch deleted file mode 100644 index 66b766d88c3527..00000000000000 --- a/0001-mtd-properly-check-all-write-ioctls-for-permissions.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 02c6bc84e034fc1930dd3e57c933ea22351e9f85 Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -Date: Sat, 11 Jul 2020 08:51:20 +0200 -Subject: [PATCH 1/2] mtd: properly check all write ioctls for permissions - -When doing a "write" ioctl call, properly check that we have permissions -to do so before copying anything from userspace or anything else so we -can "fail fast". This includes also covering the MEMWRITE ioctl which -previously missed checking for this. - -Cc: Miquel Raynal <miquel.raynal@bootlin.com> -Cc: Richard Weinberger <richard@nod.at> -Cc: Vignesh Raghavendra <vigneshr@ti.com> -Cc: stable <stable@kernel.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - drivers/mtd/mtdchar.c | 54 +++++++++++++++++++++++++++++++++++++++++--------- - 1 file changed, 45 insertions(+), 9 deletions(-) - ---- a/drivers/mtd/mtdchar.c -+++ b/drivers/mtd/mtdchar.c -@@ -355,9 +355,6 @@ static int mtdchar_writeoob(struct file - uint32_t retlen; - int ret = 0; - -- if (!(file->f_mode & FMODE_WRITE)) -- return -EPERM; -- - if (length > 4096) - return -EINVAL; - -@@ -643,6 +640,48 @@ static int mtdchar_ioctl(struct file *fi - - pr_debug("MTD_ioctl\n"); - -+ /* -+ * Check the file mode to require "dangerous" commands to have write -+ * permissions. -+ */ -+ switch (cmd) { -+ /* "safe" commands */ -+ case MEMGETREGIONCOUNT: -+ case MEMGETREGIONINFO: -+ case MEMGETINFO: -+ case MEMREADOOB: -+ case MEMREADOOB64: -+ case MEMLOCK: -+ case MEMUNLOCK: -+ case MEMISLOCKED: -+ case MEMGETOOBSEL: -+ case MEMGETBADBLOCK: -+ case MEMSETBADBLOCK: -+ case OTPSELECT: -+ case OTPGETREGIONCOUNT: -+ case OTPGETREGIONINFO: -+ case OTPLOCK: -+ case ECCGETLAYOUT: -+ case ECCGETSTATS: -+ case MTDFILEMODE: -+ case BLKPG: -+ case BLKRRPART: -+ break; -+ -+ /* "dangerous" commands */ -+ case MEMERASE: -+ case MEMERASE64: -+ case MEMWRITEOOB: -+ case MEMWRITEOOB64: -+ case MEMWRITE: -+ if (!(file->f_mode & FMODE_WRITE)) -+ return -EPERM; -+ break; -+ -+ default: -+ return -ENOTTY; -+ } -+ - switch (cmd) { - case MEMGETREGIONCOUNT: - if (copy_to_user(argp, &(mtd->numeraseregions), sizeof(int))) -@@ -690,9 +729,6 @@ static int mtdchar_ioctl(struct file *fi - { - struct erase_info *erase; - -- if(!(file->f_mode & FMODE_WRITE)) -- return -EPERM; -- - erase=kzalloc(sizeof(struct erase_info),GFP_KERNEL); - if (!erase) - ret = -ENOMEM; -@@ -985,9 +1021,6 @@ static int mtdchar_ioctl(struct file *fi - ret = 0; - break; - } -- -- default: -- ret = -ENOTTY; - } - - return ret; -@@ -1031,6 +1064,9 @@ static long mtdchar_compat_ioctl(struct - struct mtd_oob_buf32 buf; - struct mtd_oob_buf32 __user *buf_user = argp; - -+ if (!(file->f_mode & FMODE_WRITE)) -+ return -EPERM; -+ - if (copy_from_user(&buf, argp, sizeof(buf))) - ret = -EFAULT; - else diff --git a/0001-platform-x86-intel_pmc_core-do-not-create-a-static-s.patch b/0001-platform-x86-intel_pmc_core-do-not-create-a-static-s.patch new file mode 100644 index 00000000000000..23aedf2a6d4a3e --- /dev/null +++ b/0001-platform-x86-intel_pmc_core-do-not-create-a-static-s.patch @@ -0,0 +1,86 @@ +From 6dd3bc8cf1a83f09ff2ad10750e55140a32eb881 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Date: Wed, 23 Sep 2020 20:44:20 +0200 +Subject: [PATCH] platform/x86: intel_pmc_core: do not create a static struct + device + +A struct device is a dynamic structure, with reference counting. +"Tricking" the kernel to make a dynamic structure static, by working +around the driver core release detection logic, is not nice. + +Because of this, this code has been used as an example for others on +"how to do things", which is just about the worst thing possible to have +happen. + +Fix this all up by making the platform device dynamic and providing a +real release function. + +Cc: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com> +Cc: Vishwanath Somayaji <vishwanath.somayaji@intel.com> +Cc: Darren Hart <dvhart@infradead.org> +Cc: Andy Shevchenko <andy@infradead.org> +Cc: Rajat Jain <rajatja@google.com> +Cc: platform-driver-x86@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Reported-by: Maximilian Luz <luzmaximilian@gmail.com> +Fixes: b02f6a2ef0a1 ("platform/x86: intel_pmc_core: Attach using APCI HID "INT33A1"") +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/platform/x86/intel_pmc_core_pltdrv.c | 26 +++++++++++++++++--------- + 1 file changed, 17 insertions(+), 9 deletions(-) + +--- a/drivers/platform/x86/intel_pmc_core_pltdrv.c ++++ b/drivers/platform/x86/intel_pmc_core_pltdrv.c +@@ -20,15 +20,10 @@ + + static void intel_pmc_core_release(struct device *dev) + { +- /* Nothing to do. */ ++ kfree(dev); + } + +-static struct platform_device pmc_core_device = { +- .name = "intel_pmc_core", +- .dev = { +- .release = intel_pmc_core_release, +- }, +-}; ++static struct platform_device *pmc_core_device; + + /* + * intel_pmc_core_platform_ids is the list of platforms where we want to +@@ -52,6 +47,8 @@ MODULE_DEVICE_TABLE(x86cpu, intel_pmc_co + + static int __init pmc_core_platform_init(void) + { ++ int retval; ++ + /* Skip creating the platform device if ACPI already has a device */ + if (acpi_dev_present("INT33A1", NULL, -1)) + return -ENODEV; +@@ -59,12 +56,23 @@ static int __init pmc_core_platform_init + if (!x86_match_cpu(intel_pmc_core_platform_ids)) + return -ENODEV; + +- return platform_device_register(&pmc_core_device); ++ pmc_core_device = kzalloc(sizeof(*pmc_core_device), GFP_KERNEL); ++ if (!pmc_core_device) ++ return -ENOMEM; ++ ++ pmc_core_device->name = "intel_pmc_core"; ++ pmc_core_device->dev.release = intel_pmc_core_release; ++ ++ retval = platform_device_register(pmc_core_device); ++ if (retval) ++ kfree(pmc_core_device); ++ ++ return retval; + } + + static void __exit pmc_core_platform_exit(void) + { +- platform_device_unregister(&pmc_core_device); ++ platform_device_unregister(pmc_core_device); + } + + module_init(pmc_core_platform_init); diff --git a/0001-readfile-implement-readfile-syscall.patch b/0001-readfile-implement-readfile-syscall.patch index 0e0e0653b1ec33..6c90542e83401b 100644 --- a/0001-readfile-implement-readfile-syscall.patch +++ b/0001-readfile-implement-readfile-syscall.patch @@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- a/fs/open.c +++ b/fs/open.c -@@ -1370,3 +1370,53 @@ int stream_open(struct inode *inode, str +@@ -1381,3 +1381,53 @@ int stream_open(struct inode *inode, str } EXPORT_SYMBOL(stream_open); diff --git a/0001-tty-n_r3964-locking-fixups.patch b/0001-tty-n_r3964-locking-fixups.patch index 6ff8c9d24fed6e..77d8f13af100ba 100644 --- a/0001-tty-n_r3964-locking-fixups.patch +++ b/0001-tty-n_r3964-locking-fixups.patch @@ -59,7 +59,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> wake_up_interruptible(&pInfo->tty->read_wait); pInfo->state = R3964_IDLE; -@@ -743,13 +746,17 @@ static struct r3964_client_info *findCli +@@ -742,13 +745,17 @@ static struct r3964_client_info *findCli struct pid *pid) { struct r3964_client_info *pClient; @@ -79,7 +79,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } static int enable_signals(struct r3964_info *pInfo, struct pid *pid, int arg) -@@ -757,8 +764,11 @@ static int enable_signals(struct r3964_i +@@ -756,8 +763,11 @@ static int enable_signals(struct r3964_i struct r3964_client_info *pClient; struct r3964_client_info **ppClient; struct r3964_message *pMsg; @@ -91,7 +91,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> /* Remove client from client list */ for (ppClient = &pInfo->firstClient; *ppClient; ppClient = &(*ppClient)->next) { -@@ -779,9 +789,11 @@ static int enable_signals(struct r3964_i +@@ -778,9 +788,11 @@ static int enable_signals(struct r3964_i put_pid(pClient->pid); kfree(pClient); TRACE_M("enable_signals - kfree %p", pClient); @@ -103,7 +103,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> return -EINVAL; } else { pClient = findClient(pInfo, pid); -@@ -796,6 +808,7 @@ static int enable_signals(struct r3964_i +@@ -795,6 +807,7 @@ static int enable_signals(struct r3964_i if (pClient == NULL) return -ENOMEM; @@ -111,7 +111,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> TRACE_PS("add client %d to client list", pid_nr(pid)); spin_lock_init(&pClient->lock); pClient->sig_flags = arg; -@@ -806,6 +819,7 @@ static int enable_signals(struct r3964_i +@@ -805,6 +818,7 @@ static int enable_signals(struct r3964_i pClient->next_block_to_read = NULL; pClient->msg_count = 0; pInfo->firstClient = pClient; @@ -119,7 +119,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } } -@@ -850,8 +864,7 @@ static void add_msg(struct r3964_client_ +@@ -849,8 +863,7 @@ static void add_msg(struct r3964_client_ if (pClient->msg_count < R3964_MAX_MSG_COUNT - 1) { queue_the_message: @@ -129,7 +129,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> TRACE_M("add_msg - kmalloc %p", pMsg); if (pMsg == NULL) { return; -@@ -1069,9 +1082,7 @@ static ssize_t r3964_read(struct tty_str +@@ -1068,9 +1081,7 @@ static ssize_t r3964_read(struct tty_str TRACE_L("read()"); @@ -140,7 +140,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> if (file->f_flags & O_NONBLOCK) { if (!mutex_trylock(&pInfo->read_lock)) return -EAGAIN; -@@ -1193,28 +1204,45 @@ static int r3964_ioctl(struct tty_struct +@@ -1192,28 +1203,45 @@ static int r3964_ioctl(struct tty_struct unsigned int cmd, unsigned long arg) { struct r3964_info *pInfo = tty->disc_data; diff --git a/0002-arch-wire-up-the-readfile-syscall.patch b/0002-arch-wire-up-the-readfile-syscall.patch index 027af3452083ed..35f10475143f89 100644 --- a/0002-arch-wire-up-the-readfile-syscall.patch +++ b/0002-arch-wire-up-the-readfile-syscall.patch @@ -31,14 +31,14 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- a/arch/alpha/kernel/syscalls/syscall.tbl +++ b/arch/alpha/kernel/syscalls/syscall.tbl -@@ -478,3 +478,4 @@ +@@ -479,3 +479,4 @@ 547 common openat2 sys_openat2 548 common pidfd_getfd sys_pidfd_getfd 549 common faccessat2 sys_faccessat2 +550 common readfile sys_readfile --- a/arch/arm/tools/syscall.tbl +++ b/arch/arm/tools/syscall.tbl -@@ -452,3 +452,4 @@ +@@ -453,3 +453,4 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 @@ -56,7 +56,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> #define __ARCH_WANT_SYS_CLONE --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h -@@ -885,6 +885,8 @@ __SYSCALL(__NR_openat2, sys_openat2) +@@ -887,6 +887,8 @@ __SYSCALL(__NR_openat2, sys_openat2) __SYSCALL(__NR_pidfd_getfd, sys_pidfd_getfd) #define __NR_faccessat2 439 __SYSCALL(__NR_faccessat2, sys_faccessat2) @@ -67,91 +67,91 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> * Please add new compat syscalls above this comment and update --- a/arch/ia64/kernel/syscalls/syscall.tbl +++ b/arch/ia64/kernel/syscalls/syscall.tbl -@@ -359,3 +359,4 @@ +@@ -360,3 +360,4 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 +440 common readfile sys_readfile --- a/arch/m68k/kernel/syscalls/syscall.tbl +++ b/arch/m68k/kernel/syscalls/syscall.tbl -@@ -438,3 +438,4 @@ +@@ -439,3 +439,4 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 +440 common readfile sys_readfile --- a/arch/microblaze/kernel/syscalls/syscall.tbl +++ b/arch/microblaze/kernel/syscalls/syscall.tbl -@@ -444,3 +444,4 @@ +@@ -445,3 +445,4 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 +440 common readfile sys_readfile --- a/arch/mips/kernel/syscalls/syscall_n32.tbl +++ b/arch/mips/kernel/syscalls/syscall_n32.tbl -@@ -377,3 +377,4 @@ +@@ -378,3 +378,4 @@ 437 n32 openat2 sys_openat2 438 n32 pidfd_getfd sys_pidfd_getfd 439 n32 faccessat2 sys_faccessat2 +440 n32 readfile sys_readfile --- a/arch/mips/kernel/syscalls/syscall_n64.tbl +++ b/arch/mips/kernel/syscalls/syscall_n64.tbl -@@ -353,3 +353,4 @@ +@@ -354,3 +354,4 @@ 437 n64 openat2 sys_openat2 438 n64 pidfd_getfd sys_pidfd_getfd 439 n64 faccessat2 sys_faccessat2 +440 n64 readfile sys_readfile --- a/arch/mips/kernel/syscalls/syscall_o32.tbl +++ b/arch/mips/kernel/syscalls/syscall_o32.tbl -@@ -426,3 +426,4 @@ +@@ -427,3 +427,4 @@ 437 o32 openat2 sys_openat2 438 o32 pidfd_getfd sys_pidfd_getfd 439 o32 faccessat2 sys_faccessat2 +440 o32 readfile sys_readfile --- a/arch/parisc/kernel/syscalls/syscall.tbl +++ b/arch/parisc/kernel/syscalls/syscall.tbl -@@ -436,3 +436,4 @@ +@@ -437,3 +437,4 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 +440 common readfile sys_readfile --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl -@@ -528,3 +528,4 @@ +@@ -529,3 +529,4 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 +440 common readfile sys_readfile --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl -@@ -441,3 +441,4 @@ +@@ -442,3 +442,4 @@ 437 common openat2 sys_openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 sys_faccessat2 +440 common readfile sys_readfile sys_readfile --- a/arch/sh/kernel/syscalls/syscall.tbl +++ b/arch/sh/kernel/syscalls/syscall.tbl -@@ -441,3 +441,4 @@ +@@ -442,3 +442,4 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 +440 common readfile sys_readfile --- a/arch/sparc/kernel/syscalls/syscall.tbl +++ b/arch/sparc/kernel/syscalls/syscall.tbl -@@ -484,3 +484,4 @@ +@@ -485,3 +485,4 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 +440 common readfile sys_readfile --- a/arch/x86/entry/syscalls/syscall_32.tbl +++ b/arch/x86/entry/syscalls/syscall_32.tbl -@@ -443,3 +443,4 @@ +@@ -444,3 +444,4 @@ 437 i386 openat2 sys_openat2 438 i386 pidfd_getfd sys_pidfd_getfd 439 i386 faccessat2 sys_faccessat2 +440 i386 readfile sys_readfile --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl -@@ -360,6 +360,7 @@ +@@ -361,6 +361,7 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 @@ -161,14 +161,14 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # x32-specific system call numbers start at 512 to avoid cache impact --- a/arch/xtensa/kernel/syscalls/syscall.tbl +++ b/arch/xtensa/kernel/syscalls/syscall.tbl -@@ -409,3 +409,4 @@ +@@ -410,3 +410,4 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 +440 common readfile sys_readfile --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h -@@ -1005,6 +1005,8 @@ asmlinkage long sys_pidfd_send_signal(in +@@ -1006,6 +1006,8 @@ asmlinkage long sys_pidfd_send_signal(in siginfo_t __user *info, unsigned int flags); asmlinkage long sys_pidfd_getfd(int pidfd, int fd, unsigned int flags); @@ -179,7 +179,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> * Architecture-specific system calls --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h -@@ -857,9 +857,11 @@ __SYSCALL(__NR_openat2, sys_openat2) +@@ -859,9 +859,11 @@ __SYSCALL(__NR_openat2, sys_openat2) __SYSCALL(__NR_pidfd_getfd, sys_pidfd_getfd) #define __NR_faccessat2 439 __SYSCALL(__NR_faccessat2, sys_faccessat2) diff --git a/0002-tty-n_r3964-fix-poll-return-value.patch b/0002-tty-n_r3964-fix-poll-return-value.patch index f30e82114f81db..8e861506afeabd 100644 --- a/0002-tty-n_r3964-fix-poll-return-value.patch +++ b/0002-tty-n_r3964-fix-poll-return-value.patch @@ -14,7 +14,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- a/drivers/tty/n_r3964.c +++ b/drivers/tty/n_r3964.c -@@ -1286,7 +1286,7 @@ static __poll_t r3964_poll(struct tty_st +@@ -1285,7 +1285,7 @@ static __poll_t r3964_poll(struct tty_st if (pMsg) result |= EPOLLIN | EPOLLRDNORM; } else { diff --git a/0003-selftests-add-readfile-2-selftests.patch b/0003-selftests-add-readfile-2-selftests.patch index 8b9280a4fb5722..daf8a5b5b6845c 100644 --- a/0003-selftests-add-readfile-2-selftests.patch +++ b/0003-selftests-add-readfile-2-selftests.patch @@ -23,7 +23,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile -@@ -46,6 +46,7 @@ TARGETS += ptrace +@@ -49,6 +49,7 @@ TARGETS += ptrace TARGETS += openat2 TARGETS += rseq TARGETS += rtc diff --git a/0005-tty-n_r3964-split-rx-and-tx-header-structures.patch b/0005-tty-n_r3964-split-rx-and-tx-header-structures.patch index dd6ead7b86473f..90e6521e7e01ad 100644 --- a/0005-tty-n_r3964-split-rx-and-tx-header-structures.patch +++ b/0005-tty-n_r3964-split-rx-and-tx-header-structures.patch @@ -190,7 +190,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> memcpy(pBlock->data, pInfo->rx_buf, length); -@@ -905,7 +907,7 @@ static int read_telegram(struct r3964_in +@@ -904,7 +906,7 @@ static int read_telegram(struct r3964_in unsigned char __user * buf) { struct r3964_client_info *pClient; @@ -199,7 +199,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> if (!buf) { return -EINVAL; -@@ -931,7 +933,7 @@ static int read_telegram(struct r3964_in +@@ -930,7 +932,7 @@ static int read_telegram(struct r3964_in } static void add_msg(struct r3964_client_info *pClient, int msg_id, int arg, @@ -208,7 +208,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> { struct r3964_message *pMsg; unsigned long flags; -@@ -1014,7 +1016,7 @@ static struct r3964_message *remove_msg( +@@ -1013,7 +1015,7 @@ static struct r3964_message *remove_msg( static void remove_client_block(struct r3964_info *pInfo, struct r3964_client_info *pClient) { @@ -217,7 +217,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> TRACE_PS("remove_client_block PID %d", pid_nr(pClient->pid)); -@@ -1098,7 +1100,7 @@ static void r3964_close(struct tty_struc +@@ -1097,7 +1099,7 @@ static void r3964_close(struct tty_struc struct r3964_info *pInfo = tty->disc_data; struct r3964_client_info *pClient, *pNext; struct r3964_message *pMsg; @@ -226,7 +226,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> unsigned long flags; TRACE_L("close"); -@@ -1214,7 +1216,7 @@ static ssize_t r3964_write(struct tty_st +@@ -1213,7 +1215,7 @@ static ssize_t r3964_write(struct tty_st const unsigned char *data, size_t count) { struct r3964_info *pInfo = tty->disc_data; @@ -235,7 +235,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> struct r3964_client_info *pClient; unsigned char *new_data; -@@ -1239,8 +1241,7 @@ static ssize_t r3964_write(struct tty_st +@@ -1238,8 +1240,7 @@ static ssize_t r3964_write(struct tty_st /* * Allocate a buffer for the data and copy it from the buffer with header prepended */ @@ -245,7 +245,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> TRACE_M("r3964_write - kmalloc %p", new_data); if (new_data == NULL) { if (pInfo->flags & R3964_DEBUG) { -@@ -1249,10 +1250,9 @@ static ssize_t r3964_write(struct tty_st +@@ -1248,10 +1249,9 @@ static ssize_t r3964_write(struct tty_st return -ENOSPC; } diff --git a/0006-tty-n_r3964-for-tx_blocks-use-a-real-kernel-list.patch b/0006-tty-n_r3964-for-tx_blocks-use-a-real-kernel-list.patch index 579e960a08fab5..7363811ee053a4 100644 --- a/0006-tty-n_r3964-for-tx_blocks-use-a-real-kernel-list.patch +++ b/0006-tty-n_r3964-for-tx_blocks-use-a-real-kernel-list.patch @@ -143,7 +143,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> while (pInfo->tx_position < pBlock->length) { if (room < 2) -@@ -1077,7 +1048,7 @@ static int r3964_open(struct tty_struct +@@ -1076,7 +1047,7 @@ static int r3964_open(struct tty_struct pInfo->tty = tty; pInfo->priority = R3964_MASTER; pInfo->rx_first = pInfo->rx_last = NULL; @@ -152,7 +152,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> pInfo->rx_position = 0; pInfo->tx_position = 0; pInfo->last_rx = 0; -@@ -1100,7 +1071,7 @@ static void r3964_close(struct tty_struc +@@ -1099,7 +1070,7 @@ static void r3964_close(struct tty_struc struct r3964_info *pInfo = tty->disc_data; struct r3964_client_info *pClient, *pNext; struct r3964_message *pMsg; @@ -161,7 +161,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> unsigned long flags; TRACE_L("close"); -@@ -1129,15 +1100,11 @@ static void r3964_close(struct tty_struc +@@ -1128,15 +1099,11 @@ static void r3964_close(struct tty_struc } /* Remove jobs from tx_queue: */ spin_lock_irqsave(&pInfo->lock, flags); diff --git a/0007-tty-n_r3964-for-rx_blocks-use-a-real-kernel-list.patch b/0007-tty-n_r3964-for-rx_blocks-use-a-real-kernel-list.patch index 1ca4ff63029247..7e00cf063d8327 100644 --- a/0007-tty-n_r3964-for-rx_blocks-use-a-real-kernel-list.patch +++ b/0007-tty-n_r3964-for-rx_blocks-use-a-real-kernel-list.patch @@ -125,7 +125,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> memcpy(pBlock->data, pInfo->rx_buf, length); -@@ -1047,7 +1006,7 @@ static int r3964_open(struct tty_struct +@@ -1046,7 +1005,7 @@ static int r3964_open(struct tty_struct mutex_init(&pInfo->read_lock); pInfo->tty = tty; pInfo->priority = R3964_MASTER; diff --git a/0008-tty-n_r3964-don-t-hand-roll-a-reference-count.patch b/0008-tty-n_r3964-don-t-hand-roll-a-reference-count.patch index 898480f7c047b4..883505b548a82d 100644 --- a/0008-tty-n_r3964-don-t-hand-roll-a-reference-count.patch +++ b/0008-tty-n_r3964-don-t-hand-roll-a-reference-count.patch @@ -95,7 +95,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> INIT_LIST_HEAD(&pBlock->node); memcpy(pBlock->data, pInfo->rx_buf, length); -@@ -855,7 +857,7 @@ static int read_telegram(struct r3964_in +@@ -854,7 +856,7 @@ static int read_telegram(struct r3964_in if (copy_to_user(buf, block->data, block->length)) return -EFAULT; @@ -104,7 +104,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> return block->length; } -@@ -894,9 +896,9 @@ queue_the_message: +@@ -893,9 +895,9 @@ queue_the_message: pClient->msg_count++; @@ -117,7 +117,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> spin_unlock_irqrestore(&pClient->lock, flags); } else { if ((pClient->last_msg->msg_id == R3964_MSG_ACK) -@@ -935,7 +937,7 @@ static struct r3964_message *remove_msg( +@@ -934,7 +936,7 @@ static struct r3964_message *remove_msg( pClient->msg_count--; if (pMsg->block) { @@ -126,7 +126,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> pClient->next_block_to_read = pMsg->block; } spin_unlock_irqrestore(&pClient->lock, flags); -@@ -943,21 +945,14 @@ static struct r3964_message *remove_msg( +@@ -942,21 +944,14 @@ static struct r3964_message *remove_msg( return pMsg; } diff --git a/0009-tty-n_r3964-for-messages-use-a-real-kernel-list.patch b/0009-tty-n_r3964-for-messages-use-a-real-kernel-list.patch index d649a1ed124fa3..fcec159b7188ea 100644 --- a/0009-tty-n_r3964-for-messages-use-a-real-kernel-list.patch +++ b/0009-tty-n_r3964-for-messages-use-a-real-kernel-list.patch @@ -55,7 +55,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> static void remove_client_block(struct r3964_client_info *pClient); static int r3964_open(struct tty_struct *tty); -@@ -788,7 +785,7 @@ static int enable_signals(struct r3964_i +@@ -787,7 +784,7 @@ static int enable_signals(struct r3964_i pid_nr(pid)); *ppClient = pClient->next; while (pClient->msg_count) { @@ -64,7 +64,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> if (pMsg) { kfree(pMsg); TRACE_M("enable_signals - msg " -@@ -823,8 +820,7 @@ static int enable_signals(struct r3964_i +@@ -822,8 +819,7 @@ static int enable_signals(struct r3964_i pClient->sig_flags = arg; pClient->pid = get_pid(pid); pClient->next = pInfo->firstClient; @@ -74,7 +74,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> pClient->next_block_to_read = NULL; pClient->msg_count = 0; pInfo->firstClient = pClient; -@@ -864,85 +860,83 @@ static int read_telegram(struct r3964_in +@@ -863,85 +859,83 @@ static int read_telegram(struct r3964_in return -EINVAL; } @@ -213,7 +213,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } static void remove_client_block(struct r3964_client_info *client) -@@ -1041,7 +1035,7 @@ static void r3964_close(struct tty_struc +@@ -1040,7 +1034,7 @@ static void r3964_close(struct tty_struc while (pClient) { pNext = pClient->next; while (pClient->msg_count) { @@ -222,7 +222,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> if (pMsg) { kfree(pMsg); TRACE_M("r3964_close - msg kfree %p", pMsg); -@@ -1091,7 +1085,7 @@ static ssize_t r3964_read(struct tty_str +@@ -1090,7 +1084,7 @@ static ssize_t r3964_read(struct tty_str pClient = findClient(pInfo, task_pid(current)); if (pClient) { @@ -231,7 +231,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> if (pMsg == NULL) { /* no messages available. */ if (tty_io_nonblock(tty, file)) { -@@ -1100,7 +1094,7 @@ static ssize_t r3964_read(struct tty_str +@@ -1099,7 +1093,7 @@ static ssize_t r3964_read(struct tty_str } /* block until there is a message: */ wait_event_interruptible(tty->read_wait, @@ -240,7 +240,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } /* If we still haven't got a message, we must have been signalled */ -@@ -1267,7 +1261,6 @@ static __poll_t r3964_poll(struct tty_st +@@ -1266,7 +1260,6 @@ static __poll_t r3964_poll(struct tty_st { struct r3964_info *pInfo = tty->disc_data; struct r3964_client_info *pClient; @@ -248,7 +248,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> unsigned long flags; __poll_t result = EPOLLOUT; -@@ -1276,11 +1269,10 @@ static __poll_t r3964_poll(struct tty_st +@@ -1275,11 +1268,10 @@ static __poll_t r3964_poll(struct tty_st pClient = findClient(pInfo, task_pid(current)); if (pClient) { poll_wait(file, &tty->read_wait, wait); diff --git a/0010-tty-n_r3964-for-clients-use-a-real-kernel-list.patch b/0010-tty-n_r3964-for-clients-use-a-real-kernel-list.patch index 02a33c6e676bbe..ada55bb6e6aec1 100644 --- a/0010-tty-n_r3964-for-clients-use-a-real-kernel-list.patch +++ b/0010-tty-n_r3964-for-clients-use-a-real-kernel-list.patch @@ -42,7 +42,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> if (pClient->sig_flags & R3964_SIG_DATA) { add_msg(pClient, R3964_MSG_DATA, length, R3964_OK, pBlock); -@@ -755,11 +754,12 @@ static struct r3964_client_info *findCli +@@ -754,11 +753,12 @@ static struct r3964_client_info *findCli unsigned long flags; spin_lock_irqsave(&pInfo->lock, flags); @@ -56,7 +56,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> exit: spin_unlock_irqrestore(&pInfo->lock, flags); return pClient; -@@ -768,7 +768,6 @@ exit: +@@ -767,7 +767,6 @@ exit: static int enable_signals(struct r3964_info *pInfo, struct pid *pid, int arg) { struct r3964_client_info *pClient; @@ -64,7 +64,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> struct r3964_message *pMsg; unsigned long flags; -@@ -776,14 +775,10 @@ static int enable_signals(struct r3964_i +@@ -775,14 +774,10 @@ static int enable_signals(struct r3964_i spin_lock_irqsave(&pInfo->lock, flags); /* Remove client from client list */ @@ -80,7 +80,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> while (pClient->msg_count) { pMsg = remove_msg(pClient); if (pMsg) { -@@ -793,6 +788,7 @@ static int enable_signals(struct r3964_i +@@ -792,6 +787,7 @@ static int enable_signals(struct r3964_i } } put_pid(pClient->pid); @@ -88,7 +88,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> kfree(pClient); TRACE_M("enable_signals - kfree %p", pClient); spin_unlock_irqrestore(&pInfo->lock, flags); -@@ -819,11 +815,10 @@ static int enable_signals(struct r3964_i +@@ -818,11 +814,10 @@ static int enable_signals(struct r3964_i spin_lock_init(&pClient->lock); pClient->sig_flags = arg; pClient->pid = get_pid(pid); @@ -101,7 +101,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> spin_unlock_irqrestore(&pInfo->lock, flags); } } -@@ -1001,7 +996,7 @@ static int r3964_open(struct tty_struct +@@ -1000,7 +995,7 @@ static int r3964_open(struct tty_struct pInfo->tx_position = 0; pInfo->last_rx = 0; pInfo->blocks_in_rx_queue = 0; @@ -110,7 +110,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> pInfo->state = R3964_IDLE; pInfo->flags = R3964_DEBUG; pInfo->nRetry = 0; -@@ -1017,7 +1012,7 @@ static int r3964_open(struct tty_struct +@@ -1016,7 +1011,7 @@ static int r3964_open(struct tty_struct static void r3964_close(struct tty_struct *tty) { struct r3964_info *pInfo = tty->disc_data; @@ -119,7 +119,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> struct r3964_message *pMsg; struct tx_block_header *pHeader, *tmp; unsigned long flags; -@@ -1031,9 +1026,7 @@ static void r3964_close(struct tty_struc +@@ -1030,9 +1025,7 @@ static void r3964_close(struct tty_struc del_timer_sync(&pInfo->tmr); /* Remove client-structs and message queues: */ @@ -130,7 +130,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> while (pClient->msg_count) { pMsg = remove_msg(pClient); if (pMsg) { -@@ -1042,9 +1035,9 @@ static void r3964_close(struct tty_struc +@@ -1041,9 +1034,9 @@ static void r3964_close(struct tty_struc } } put_pid(pClient->pid); diff --git a/0011-tty-n_r3964-fix-race-with-add_msg-and-read_telegram.patch b/0011-tty-n_r3964-fix-race-with-add_msg-and-read_telegram.patch index e34558b35198db..a035acb550c9c0 100644 --- a/0011-tty-n_r3964-fix-race-with-add_msg-and-read_telegram.patch +++ b/0011-tty-n_r3964-fix-race-with-add_msg-and-read_telegram.patch @@ -31,7 +31,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> static void add_msg(struct r3964_client_info *pClient, int msg_id, int arg, int error_code, struct rx_block_header *pBlock); static struct r3964_message *remove_msg(struct r3964_client_info *client); -@@ -831,6 +829,10 @@ static int read_telegram(struct r3964_in +@@ -830,6 +828,10 @@ static int read_telegram(struct r3964_in { struct r3964_client_info *pClient; struct rx_block_header *block; @@ -42,7 +42,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> if (!buf) { return -EINVAL; -@@ -841,18 +843,47 @@ static int read_telegram(struct r3964_in +@@ -840,18 +842,47 @@ static int read_telegram(struct r3964_in return -EINVAL; } @@ -98,7 +98,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } static void __add_msg(struct r3964_client_info *pClient, int msg_id, int arg, -@@ -935,6 +966,7 @@ static struct r3964_message *remove_msg( +@@ -934,6 +965,7 @@ static struct r3964_message *remove_msg( } static void remove_client_block(struct r3964_client_info *client) diff --git a/0012-tty-n_r3964-remove-read_lock-from-some-ioctls.patch b/0012-tty-n_r3964-remove-read_lock-from-some-ioctls.patch index 7ffbf114f76303..c27f4026fbe3b9 100644 --- a/0012-tty-n_r3964-remove-read_lock-from-some-ioctls.patch +++ b/0012-tty-n_r3964-remove-read_lock-from-some-ioctls.patch @@ -27,7 +27,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> struct list_head clients; unsigned int state; -@@ -1219,33 +1220,41 @@ static int r3964_ioctl(struct tty_struct +@@ -1218,33 +1219,41 @@ static int r3964_ioctl(struct tty_struct unsigned int cmd, unsigned long arg) { struct r3964_info *pInfo = tty->disc_data; @@ -77,7 +77,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> break; case R3964_READ_TELEGRAM: retval = read_telegram(pInfo, task_pid(current), -@@ -1256,7 +1265,6 @@ static int r3964_ioctl(struct tty_struct +@@ -1255,7 +1264,6 @@ static int r3964_ioctl(struct tty_struct break; } diff --git a/0013-tty-n_r3964-properly-protect-sig_flags-of-client-str.patch b/0013-tty-n_r3964-properly-protect-sig_flags-of-client-str.patch index 9842a56d052f1e..5bbcd6030d1c9a 100644 --- a/0013-tty-n_r3964-properly-protect-sig_flags-of-client-str.patch +++ b/0013-tty-n_r3964-properly-protect-sig_flags-of-client-str.patch @@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> add_msg(pClient, R3964_MSG_DATA, length, R3964_OK, pBlock); } -@@ -799,8 +805,12 @@ static int enable_signals(struct r3964_i +@@ -798,8 +804,12 @@ static int enable_signals(struct r3964_i } else { pClient = findClient(pInfo, pid); if (pClient) { @@ -51,7 +51,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } else { /* add client to client list */ pClient = kmalloc(sizeof(struct r3964_client_info), -@@ -915,6 +925,7 @@ static void add_msg(struct r3964_client_ +@@ -914,6 +924,7 @@ static void add_msg(struct r3964_client_ { struct r3964_message *pMsg; unsigned long flags; @@ -59,7 +59,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> spin_lock_irqsave(&pClient->lock, flags); -@@ -935,12 +946,13 @@ static void add_msg(struct r3964_client_ +@@ -934,12 +945,13 @@ static void add_msg(struct r3964_client_ TRACE_PE("add_msg - queue OVERFLOW-msg"); } } diff --git a/0014-tty-n_r3964-properly-reference-count-pids.patch b/0014-tty-n_r3964-properly-reference-count-pids.patch index 0962fd7154d197..00131e5ac5d75f 100644 --- a/0014-tty-n_r3964-properly-reference-count-pids.patch +++ b/0014-tty-n_r3964-properly-reference-count-pids.patch @@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- a/drivers/tty/n_r3964.c +++ b/drivers/tty/n_r3964.c -@@ -770,6 +770,18 @@ exit: +@@ -769,6 +769,18 @@ exit: return pClient; } @@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> static int enable_signals(struct r3964_info *pInfo, struct pid *pid, int arg) { struct r3964_client_info *pClient; -@@ -1121,7 +1133,7 @@ static ssize_t r3964_read(struct tty_str +@@ -1120,7 +1132,7 @@ static ssize_t r3964_read(struct tty_str return -ERESTARTSYS; } @@ -47,7 +47,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> if (pClient) { pMsg = remove_msg(pClient); if (pMsg == NULL) { -@@ -1208,7 +1220,7 @@ static ssize_t r3964_write(struct tty_st +@@ -1207,7 +1219,7 @@ static ssize_t r3964_write(struct tty_st pHeader->length = count; pHeader->owner = NULL; @@ -56,7 +56,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> if (pClient) { pHeader->owner = pClient; } -@@ -1232,6 +1244,7 @@ static int r3964_ioctl(struct tty_struct +@@ -1231,6 +1243,7 @@ static int r3964_ioctl(struct tty_struct unsigned int cmd, unsigned long arg) { struct r3964_info *pInfo = tty->disc_data; @@ -64,7 +64,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> unsigned long flags; int retval = 0; -@@ -1249,7 +1262,9 @@ static int r3964_ioctl(struct tty_struct +@@ -1248,7 +1261,9 @@ static int r3964_ioctl(struct tty_struct return -ERESTARTSYS; } @@ -75,7 +75,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> mutex_unlock(&pInfo->read_lock); break; -@@ -1269,8 +1284,9 @@ static int r3964_ioctl(struct tty_struct +@@ -1268,8 +1283,9 @@ static int r3964_ioctl(struct tty_struct spin_unlock_irqrestore(&pInfo->lock, flags); break; case R3964_READ_TELEGRAM: @@ -87,7 +87,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> break; default: retval = -ENOIOCTLCMD; -@@ -1311,7 +1327,7 @@ static __poll_t r3964_poll(struct tty_st +@@ -1310,7 +1326,7 @@ static __poll_t r3964_poll(struct tty_st TRACE_L("POLL"); diff --git a/0015-tty-n_r3964-add-reference-counting-to-the-client-str.patch b/0015-tty-n_r3964-add-reference-counting-to-the-client-str.patch index 0cdeb7fcb0ed4e..ec31e9dbb8b167 100644 --- a/0015-tty-n_r3964-add-reference-counting-to-the-client-str.patch +++ b/0015-tty-n_r3964-add-reference-counting-to-the-client-str.patch @@ -86,7 +86,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } spin_unlock_irqrestore(&pInfo->lock, flags); wake_up_interruptible(&pInfo->tty->read_wait); -@@ -752,25 +780,40 @@ static void on_timeout(struct timer_list +@@ -751,25 +779,40 @@ static void on_timeout(struct timer_list } } @@ -131,7 +131,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> static struct r3964_client_info *find_client_current(struct r3964_info *info) { struct r3964_client_info *client; -@@ -793,6 +836,7 @@ static int enable_signals(struct r3964_i +@@ -792,6 +835,7 @@ static int enable_signals(struct r3964_i /* Remove client from client list */ list_for_each_entry(pClient, &pInfo->clients, node) { @@ -139,7 +139,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> if (pClient->pid == pid) { TRACE_PS("removing client %d from client list", pid_nr(pid)); -@@ -804,13 +848,13 @@ static int enable_signals(struct r3964_i +@@ -803,13 +847,13 @@ static int enable_signals(struct r3964_i "kfree %p", pMsg); } } @@ -157,7 +157,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } spin_unlock_irqrestore(&pInfo->lock, flags); return -EINVAL; -@@ -823,6 +867,7 @@ static int enable_signals(struct r3964_i +@@ -822,6 +866,7 @@ static int enable_signals(struct r3964_i spin_lock_irqsave(&pClient->lock, client_flags); pClient->sig_flags = arg; spin_unlock_irqrestore(&pClient->lock, client_flags); @@ -165,7 +165,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } else { /* add client to client list */ pClient = kmalloc(sizeof(struct r3964_client_info), -@@ -834,6 +879,7 @@ static int enable_signals(struct r3964_i +@@ -833,6 +878,7 @@ static int enable_signals(struct r3964_i spin_lock_irqsave(&pInfo->lock, flags); TRACE_PS("add client %d to client list", pid_nr(pid)); spin_lock_init(&pClient->lock); @@ -173,7 +173,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> pClient->sig_flags = arg; pClient->pid = get_pid(pid); INIT_LIST_HEAD(&pClient->msgs); -@@ -887,6 +933,7 @@ static int read_telegram(struct r3964_in +@@ -886,6 +932,7 @@ static int read_telegram(struct r3964_in if (copy_to_user(buf, data, length)) { kfree(data); @@ -181,7 +181,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> return -EFAULT; } kfree(data); -@@ -906,6 +953,7 @@ static int read_telegram(struct r3964_in +@@ -905,6 +952,7 @@ static int read_telegram(struct r3964_in exit: spin_unlock_irqrestore(&pClient->lock, flags); @@ -189,7 +189,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> return retval; } -@@ -1091,10 +1139,7 @@ static void r3964_close(struct tty_struc +@@ -1090,10 +1138,7 @@ static void r3964_close(struct tty_struc TRACE_M("r3964_close - msg kfree %p", pMsg); } } @@ -201,7 +201,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } /* Remove jobs from tx_queue: */ spin_lock_irqsave(&pInfo->lock, flags); -@@ -1174,6 +1219,7 @@ static ssize_t r3964_read(struct tty_str +@@ -1173,6 +1218,7 @@ static ssize_t r3964_read(struct tty_str ret = -EPERM; unlock: mutex_unlock(&pInfo->read_lock); @@ -209,7 +209,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> return ret; } -@@ -1182,7 +1228,6 @@ static ssize_t r3964_write(struct tty_st +@@ -1181,7 +1227,6 @@ static ssize_t r3964_write(struct tty_st { struct r3964_info *pInfo = tty->disc_data; struct tx_block_header *pHeader; @@ -217,7 +217,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> unsigned char *new_data; TRACE_L("write request, %d characters", count); -@@ -1218,12 +1263,12 @@ static ssize_t r3964_write(struct tty_st +@@ -1217,12 +1262,12 @@ static ssize_t r3964_write(struct tty_st pHeader = (struct tx_block_header *)new_data; pHeader->data = new_data + sizeof(*pHeader); pHeader->length = count; @@ -235,7 +235,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> memcpy(pHeader->data, data, count); /* We already verified this */ -@@ -1334,6 +1379,7 @@ static __poll_t r3964_poll(struct tty_st +@@ -1333,6 +1378,7 @@ static __poll_t r3964_poll(struct tty_st if (!list_empty(&pClient->msgs)) result |= EPOLLIN | EPOLLRDNORM; spin_unlock_irqrestore(&pClient->lock, flags); @@ -1,6 +1,5 @@ # -0001-mtd-properly-check-all-write-ioctls-for-permissions.patch -0001-USB-iowarrior-fix-up-report-size-handling-for-some-d.patch +0001-platform-x86-intel_pmc_core-do-not-create-a-static-s.patch 0001-readfile-implement-readfile-syscall.patch 0002-arch-wire-up-the-readfile-syscall.patch 0003-selftests-add-readfile-2-selftests.patch diff --git a/usb_DEVICE_ATTR.patch b/usb_DEVICE_ATTR.patch index 0c707ffde70c98..6bcb207f0926e9 100644 --- a/usb_DEVICE_ATTR.patch +++ b/usb_DEVICE_ATTR.patch @@ -13,12 +13,11 @@ future. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/usb/gadget/function/f_mass_storage.c | 5 ++--- - drivers/usb/phy/phy-fsl-usb.c | 6 +++--- - 2 files changed, 5 insertions(+), 6 deletions(-) + 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c -@@ -2554,9 +2554,8 @@ static ssize_t file_store(struct device +@@ -2553,9 +2553,8 @@ static ssize_t file_store(struct device } static DEVICE_ATTR_RW(nofua); @@ -30,25 +29,3 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> /****************************** FSG COMMON ******************************/ ---- a/drivers/usb/phy/phy-fsl-usb.c -+++ b/drivers/usb/phy/phy-fsl-usb.c -@@ -960,8 +960,8 @@ int usb_otg_start(struct platform_device - /* - * state file in sysfs - */ --static ssize_t show_fsl_usb2_otg_state(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t fsl_usb2_otg_state_show(struct device *dev, -+ struct device_attribute *attr, char *buf) - { - struct otg_fsm *fsm = &fsl_otg_dev->fsm; - char *next = buf; -@@ -1041,7 +1041,7 @@ static ssize_t show_fsl_usb2_otg_state(s - return PAGE_SIZE - size; - } - --static DEVICE_ATTR(fsl_usb2_otg_state, S_IRUGO, show_fsl_usb2_otg_state, NULL); -+static DEVICE_ATTR_RO(fsl_usb2_otg_state); - - static struct attribute *fsl_otg_attrs[] = { - &dev_attr_fsl_usb2_otg_state.attr, |