]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Mar 2021 09:36:26 +0000 (10:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Mar 2021 09:36:26 +0000 (10:36 +0100)
added patches:
blk-settings-align-max_sectors-on-logical_block_size-boundary.patch
block-move-sector_size-and-sector_shift-definitions-into-linux-blkdev.h.patch
input-i8042-add-asus-zenbook-flip-to-noselftest-list.patch
input-joydev-prevent-potential-read-overflow-in-ioctl.patch
input-xpad-add-support-for-powera-enhanced-wired-controller-for-xbox-series-x-s.patch

queue-4.4/blk-settings-align-max_sectors-on-logical_block_size-boundary.patch [new file with mode: 0644]
queue-4.4/block-move-sector_size-and-sector_shift-definitions-into-linux-blkdev.h.patch [new file with mode: 0644]
queue-4.4/input-i8042-add-asus-zenbook-flip-to-noselftest-list.patch [new file with mode: 0644]
queue-4.4/input-joydev-prevent-potential-read-overflow-in-ioctl.patch [new file with mode: 0644]
queue-4.4/input-xpad-add-support-for-powera-enhanced-wired-controller-for-xbox-series-x-s.patch [new file with mode: 0644]
queue-4.4/scsi-bnx2fc-fix-kconfig-warning-cnic-build-errors.patch
queue-4.4/series

diff --git a/queue-4.4/blk-settings-align-max_sectors-on-logical_block_size-boundary.patch b/queue-4.4/blk-settings-align-max_sectors-on-logical_block_size-boundary.patch
new file mode 100644 (file)
index 0000000..45a9b69
--- /dev/null
@@ -0,0 +1,68 @@
+From 97f433c3601a24d3513d06f575a389a2ca4e11e4 Mon Sep 17 00:00:00 2001
+From: Mikulas Patocka <mpatocka@redhat.com>
+Date: Tue, 23 Feb 2021 19:25:30 -0700
+Subject: blk-settings: align max_sectors on "logical_block_size" boundary
+
+From: Mikulas Patocka <mpatocka@redhat.com>
+
+commit 97f433c3601a24d3513d06f575a389a2ca4e11e4 upstream.
+
+We get I/O errors when we run md-raid1 on the top of dm-integrity on the
+top of ramdisk.
+device-mapper: integrity: Bio not aligned on 8 sectors: 0xff00, 0xff
+device-mapper: integrity: Bio not aligned on 8 sectors: 0xff00, 0xff
+device-mapper: integrity: Bio not aligned on 8 sectors: 0xffff, 0x1
+device-mapper: integrity: Bio not aligned on 8 sectors: 0xffff, 0x1
+device-mapper: integrity: Bio not aligned on 8 sectors: 0x8048, 0xff
+device-mapper: integrity: Bio not aligned on 8 sectors: 0x8147, 0xff
+device-mapper: integrity: Bio not aligned on 8 sectors: 0x8246, 0xff
+device-mapper: integrity: Bio not aligned on 8 sectors: 0x8345, 0xbb
+
+The ramdisk device has logical_block_size 512 and max_sectors 255. The
+dm-integrity device uses logical_block_size 4096 and it doesn't affect the
+"max_sectors" value - thus, it inherits 255 from the ramdisk. So, we have
+a device with max_sectors not aligned on logical_block_size.
+
+The md-raid device sees that the underlying leg has max_sectors 255 and it
+will split the bios on 255-sector boundary, making the bios unaligned on
+logical_block_size.
+
+In order to fix the bug, we round down max_sectors to logical_block_size.
+
+Cc: stable@vger.kernel.org
+Reviewed-by: Ming Lei <ming.lei@redhat.com>
+Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/blk-settings.c |   12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/block/blk-settings.c
++++ b/block/blk-settings.c
+@@ -494,6 +494,14 @@ void blk_queue_stack_limits(struct reque
+ }
+ EXPORT_SYMBOL(blk_queue_stack_limits);
++static unsigned int blk_round_down_sectors(unsigned int sectors, unsigned int lbs)
++{
++      sectors = round_down(sectors, lbs >> SECTOR_SHIFT);
++      if (sectors < PAGE_SIZE >> SECTOR_SHIFT)
++              sectors = PAGE_SIZE >> SECTOR_SHIFT;
++      return sectors;
++}
++
+ /**
+  * blk_stack_limits - adjust queue_limits for stacked devices
+  * @t:        the stacking driver limits (top device)
+@@ -606,6 +614,10 @@ int blk_stack_limits(struct queue_limits
+               ret = -1;
+       }
++      t->max_sectors = blk_round_down_sectors(t->max_sectors, t->logical_block_size);
++      t->max_hw_sectors = blk_round_down_sectors(t->max_hw_sectors, t->logical_block_size);
++      t->max_dev_sectors = blk_round_down_sectors(t->max_dev_sectors, t->logical_block_size);
++
+       /* Discard alignment and granularity */
+       if (b->discard_granularity) {
+               alignment = queue_limit_discard_alignment(b, start);
diff --git a/queue-4.4/block-move-sector_size-and-sector_shift-definitions-into-linux-blkdev.h.patch b/queue-4.4/block-move-sector_size-and-sector_shift-definitions-into-linux-blkdev.h.patch
new file mode 100644 (file)
index 0000000..8d0cf74
--- /dev/null
@@ -0,0 +1,310 @@
+From d24c407b0f7af675a3928fdd4121306ad32c60ab Mon Sep 17 00:00:00 2001
+From: Bart Van Assche <bart.vanassche@wdc.com>
+Date: Wed, 14 Mar 2018 15:48:06 -0700
+Subject: block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into <linux/blkdev.h>
+
+From: Bart Van Assche <bart.vanassche@wdc.com>
+
+commit 233bde21aa43516baa013ef7ac33f3427056db3e upstream.
+
+It happens often while I'm preparing a patch for a block driver that
+I'm wondering: is a definition of SECTOR_SIZE and/or SECTOR_SHIFT
+available for this driver? Do I have to introduce definitions of these
+constants before I can use these constants? To avoid this confusion,
+move the existing definitions of SECTOR_SIZE and SECTOR_SHIFT into the
+<linux/blkdev.h> header file such that these become available for all
+block drivers. Make the SECTOR_SIZE definition in the uapi msdos_fs.h
+header file conditional to avoid that including that header file after
+<linux/blkdev.h> causes the compiler to complain about a SECTOR_SIZE
+redefinition.
+
+Note: the SECTOR_SIZE / SECTOR_SHIFT / SECTOR_BITS definitions have
+not been removed from uapi header files nor from NAND drivers in
+which these constants are used for another purpose than converting
+block layer offsets and sizes into a number of sectors.
+
+Cc: David S. Miller <davem@davemloft.net>
+Cc: Mike Snitzer <snitzer@redhat.com>
+Cc: Dan Williams <dan.j.williams@intel.com>
+Cc: Minchan Kim <minchan@kernel.org>
+Cc: Nitin Gupta <ngupta@vflare.org>
+Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/xtensa/platforms/iss/simdisk.c |    1 
+ drivers/block/brd.c                 |    1 
+ drivers/block/rbd.c                 |    9 -------
+ drivers/block/zram/zram_drv.h       |    1 
+ drivers/ide/ide-cd.c                |    8 +++---
+ drivers/ide/ide-cd.h                |    6 -----
+ drivers/nvdimm/nd.h                 |    1 
+ drivers/scsi/gdth.h                 |    3 --
+ include/linux/blkdev.h              |   42 ++++++++++++++++++++++++++----------
+ include/linux/device-mapper.h       |    2 -
+ include/linux/ide.h                 |    1 
+ include/uapi/linux/msdos_fs.h       |    2 +
+ 12 files changed, 38 insertions(+), 39 deletions(-)
+
+--- a/arch/xtensa/platforms/iss/simdisk.c
++++ b/arch/xtensa/platforms/iss/simdisk.c
+@@ -21,7 +21,6 @@
+ #include <platform/simcall.h>
+ #define SIMDISK_MAJOR 240
+-#define SECTOR_SHIFT 9
+ #define SIMDISK_MINORS 1
+ #define MAX_SIMDISK_COUNT 10
+--- a/drivers/block/brd.c
++++ b/drivers/block/brd.c
+@@ -22,7 +22,6 @@
+ #include <asm/uaccess.h>
+-#define SECTOR_SHIFT          9
+ #define PAGE_SECTORS_SHIFT    (PAGE_SHIFT - SECTOR_SHIFT)
+ #define PAGE_SECTORS          (1 << PAGE_SECTORS_SHIFT)
+--- a/drivers/block/rbd.c
++++ b/drivers/block/rbd.c
+@@ -50,15 +50,6 @@
+ #define RBD_DEBUG     /* Activate rbd_assert() calls */
+ /*
+- * The basic unit of block I/O is a sector.  It is interpreted in a
+- * number of contexts in Linux (blk, bio, genhd), but the default is
+- * universally 512 bytes.  These symbols are just slightly more
+- * meaningful than the bare numbers they represent.
+- */
+-#define       SECTOR_SHIFT    9
+-#define       SECTOR_SIZE     (1ULL << SECTOR_SHIFT)
+-
+-/*
+  * Increment the given counter and return its updated value.
+  * If the counter is already 0 it will not be incremented.
+  * If the counter is already at its maximum value returns
+--- a/drivers/block/zram/zram_drv.h
++++ b/drivers/block/zram/zram_drv.h
+@@ -36,7 +36,6 @@ static const size_t max_zpage_size = PAG
+ /*-- End of configurable params */
+-#define SECTOR_SHIFT          9
+ #define SECTORS_PER_PAGE_SHIFT        (PAGE_SHIFT - SECTOR_SHIFT)
+ #define SECTORS_PER_PAGE      (1 << SECTORS_PER_PAGE_SHIFT)
+ #define ZRAM_LOGICAL_BLOCK_SHIFT 12
+--- a/drivers/ide/ide-cd.c
++++ b/drivers/ide/ide-cd.c
+@@ -704,7 +704,7 @@ static ide_startstop_t cdrom_start_rw(id
+       struct request_queue *q = drive->queue;
+       int write = rq_data_dir(rq) == WRITE;
+       unsigned short sectors_per_frame =
+-              queue_logical_block_size(q) >> SECTOR_BITS;
++              queue_logical_block_size(q) >> SECTOR_SHIFT;
+       ide_debug_log(IDE_DBG_RQ, "rq->cmd[0]: 0x%x, rq->cmd_flags: 0x%x, "
+                                 "secs_per_frame: %u",
+@@ -900,7 +900,7 @@ static int cdrom_read_capacity(ide_drive
+        * end up being bogus.
+        */
+       blocklen = be32_to_cpu(capbuf.blocklen);
+-      blocklen = (blocklen >> SECTOR_BITS) << SECTOR_BITS;
++      blocklen = (blocklen >> SECTOR_SHIFT) << SECTOR_SHIFT;
+       switch (blocklen) {
+       case 512:
+       case 1024:
+@@ -916,7 +916,7 @@ static int cdrom_read_capacity(ide_drive
+       }
+       *capacity = 1 + be32_to_cpu(capbuf.lba);
+-      *sectors_per_frame = blocklen >> SECTOR_BITS;
++      *sectors_per_frame = blocklen >> SECTOR_SHIFT;
+       ide_debug_log(IDE_DBG_PROBE, "cap: %lu, sectors_per_frame: %lu",
+                                    *capacity, *sectors_per_frame);
+@@ -993,7 +993,7 @@ int ide_cd_read_toc(ide_drive_t *drive,
+       drive->probed_capacity = toc->capacity * sectors_per_frame;
+       blk_queue_logical_block_size(drive->queue,
+-                                   sectors_per_frame << SECTOR_BITS);
++                                   sectors_per_frame << SECTOR_SHIFT);
+       /* first read just the header, so we know how long the TOC is */
+       stat = cdrom_read_tocentry(drive, 0, 1, 0, (char *) &toc->hdr,
+--- a/drivers/ide/ide-cd.h
++++ b/drivers/ide/ide-cd.h
+@@ -20,11 +20,7 @@
+ /************************************************************************/
+-#define SECTOR_BITS           9
+-#ifndef SECTOR_SIZE
+-#define SECTOR_SIZE           (1 << SECTOR_BITS)
+-#endif
+-#define SECTORS_PER_FRAME     (CD_FRAMESIZE >> SECTOR_BITS)
++#define SECTORS_PER_FRAME     (CD_FRAMESIZE >> SECTOR_SHIFT)
+ #define SECTOR_BUFFER_SIZE    (CD_FRAMESIZE * 32)
+ /* Capabilities Page size including 8 bytes of Mode Page Header */
+--- a/drivers/nvdimm/nd.h
++++ b/drivers/nvdimm/nd.h
+@@ -27,7 +27,6 @@ enum {
+        * BTT instance
+        */
+       ND_MAX_LANES = 256,
+-      SECTOR_SHIFT = 9,
+       INT_LBASIZE_ALIGNMENT = 64,
+ #if IS_ENABLED(CONFIG_NVDIMM_PFN)
+       ND_PFN_ALIGN = PAGES_PER_SECTION * PAGE_SIZE,
+--- a/drivers/scsi/gdth.h
++++ b/drivers/scsi/gdth.h
+@@ -177,9 +177,6 @@
+ #define MSG_SIZE        34                      /* size of message structure */
+ #define MSG_REQUEST     0                       /* async. event: message */
+-/* cacheservice defines */
+-#define SECTOR_SIZE     0x200                   /* always 512 bytes per sec. */
+-
+ /* DPMEM constants */
+ #define DPMEM_MAGIC     0xC0FFEE11
+ #define IC_HEADER_BYTES 48
+--- a/include/linux/blkdev.h
++++ b/include/linux/blkdev.h
+@@ -833,6 +833,19 @@ static inline struct request_queue *bdev
+ }
+ /*
++ * The basic unit of block I/O is a sector. It is used in a number of contexts
++ * in Linux (blk, bio, genhd). The size of one sector is 512 = 2**9
++ * bytes. Variables of type sector_t represent an offset or size that is a
++ * multiple of 512 bytes. Hence these two constants.
++ */
++#ifndef SECTOR_SHIFT
++#define SECTOR_SHIFT 9
++#endif
++#ifndef SECTOR_SIZE
++#define SECTOR_SIZE (1 << SECTOR_SHIFT)
++#endif
++
++/*
+  * blk_rq_pos()                       : the current sector
+  * blk_rq_bytes()             : bytes left in the entire request
+  * blk_rq_cur_bytes()         : bytes left in the current segment
+@@ -859,19 +872,20 @@ extern unsigned int blk_rq_err_bytes(con
+ static inline unsigned int blk_rq_sectors(const struct request *rq)
+ {
+-      return blk_rq_bytes(rq) >> 9;
++      return blk_rq_bytes(rq) >> SECTOR_SHIFT;
+ }
+ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
+ {
+-      return blk_rq_cur_bytes(rq) >> 9;
++      return blk_rq_cur_bytes(rq) >> SECTOR_SHIFT;
+ }
+ static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q,
+                                                    unsigned int cmd_flags)
+ {
+       if (unlikely(cmd_flags & REQ_DISCARD))
+-              return min(q->limits.max_discard_sectors, UINT_MAX >> 9);
++              return min(q->limits.max_discard_sectors,
++                         UINT_MAX >> SECTOR_SHIFT);
+       if (unlikely(cmd_flags & REQ_WRITE_SAME))
+               return q->limits.max_write_same_sectors;
+@@ -1134,16 +1148,21 @@ extern int blkdev_issue_zeroout(struct b
+ static inline int sb_issue_discard(struct super_block *sb, sector_t block,
+               sector_t nr_blocks, gfp_t gfp_mask, unsigned long flags)
+ {
+-      return blkdev_issue_discard(sb->s_bdev, block << (sb->s_blocksize_bits - 9),
+-                                  nr_blocks << (sb->s_blocksize_bits - 9),
++      return blkdev_issue_discard(sb->s_bdev,
++                                  block << (sb->s_blocksize_bits -
++                                            SECTOR_SHIFT),
++                                  nr_blocks << (sb->s_blocksize_bits -
++                                                SECTOR_SHIFT),
+                                   gfp_mask, flags);
+ }
+ static inline int sb_issue_zeroout(struct super_block *sb, sector_t block,
+               sector_t nr_blocks, gfp_t gfp_mask)
+ {
+       return blkdev_issue_zeroout(sb->s_bdev,
+-                                  block << (sb->s_blocksize_bits - 9),
+-                                  nr_blocks << (sb->s_blocksize_bits - 9),
++                                  block << (sb->s_blocksize_bits -
++                                            SECTOR_SHIFT),
++                                  nr_blocks << (sb->s_blocksize_bits -
++                                                SECTOR_SHIFT),
+                                   gfp_mask, true);
+ }
+@@ -1250,7 +1269,8 @@ static inline int queue_alignment_offset
+ static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
+ {
+       unsigned int granularity = max(lim->physical_block_size, lim->io_min);
+-      unsigned int alignment = sector_div(sector, granularity >> 9) << 9;
++      unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
++              << SECTOR_SHIFT;
+       return (granularity + lim->alignment_offset - alignment) % granularity;
+ }
+@@ -1284,8 +1304,8 @@ static inline int queue_limit_discard_al
+               return 0;
+       /* Why are these in bytes, not sectors? */
+-      alignment = lim->discard_alignment >> 9;
+-      granularity = lim->discard_granularity >> 9;
++      alignment = lim->discard_alignment >> SECTOR_SHIFT;
++      granularity = lim->discard_granularity >> SECTOR_SHIFT;
+       if (!granularity)
+               return 0;
+@@ -1296,7 +1316,7 @@ static inline int queue_limit_discard_al
+       offset = (granularity + alignment - offset) % granularity;
+       /* Turn it back into bytes, gaah */
+-      return offset << 9;
++      return offset << SECTOR_SHIFT;
+ }
+ static inline int bdev_discard_alignment(struct block_device *bdev)
+--- a/include/linux/device-mapper.h
++++ b/include/linux/device-mapper.h
+@@ -543,8 +543,6 @@ extern struct ratelimit_state dm_ratelim
+ #define DMEMIT(x...) sz += ((sz >= maxlen) ? \
+                         0 : scnprintf(result + sz, maxlen - sz, x))
+-#define SECTOR_SHIFT 9
+-
+ /*
+  * Definitions of return values from target end_io function.
+  */
+--- a/include/linux/ide.h
++++ b/include/linux/ide.h
+@@ -128,7 +128,6 @@ struct ide_io_ports {
+  */
+ #define PARTN_BITS    6       /* number of minor dev bits for partitions */
+ #define MAX_DRIVES    2       /* per interface; 2 assumed by lots of code */
+-#define SECTOR_SIZE   512
+ /*
+  * Timeouts for various operations:
+--- a/include/uapi/linux/msdos_fs.h
++++ b/include/uapi/linux/msdos_fs.h
+@@ -9,7 +9,9 @@
+  * The MS-DOS filesystem constants/structures
+  */
++#ifndef SECTOR_SIZE
+ #define SECTOR_SIZE   512             /* sector size (bytes) */
++#endif
+ #define SECTOR_BITS   9               /* log2(SECTOR_SIZE) */
+ #define MSDOS_DPB     (MSDOS_DPS)     /* dir entries per block */
+ #define MSDOS_DPB_BITS        4               /* log2(MSDOS_DPB) */
diff --git a/queue-4.4/input-i8042-add-asus-zenbook-flip-to-noselftest-list.patch b/queue-4.4/input-i8042-add-asus-zenbook-flip-to-noselftest-list.patch
new file mode 100644 (file)
index 0000000..311d672
--- /dev/null
@@ -0,0 +1,41 @@
+From b5d6e7ab7fe7d186878142e9fc1a05e4c3b65eb9 Mon Sep 17 00:00:00 2001
+From: Marcos Paulo de Souza <mpdesouza@suse.com>
+Date: Fri, 19 Feb 2021 10:37:13 -0800
+Subject: Input: i8042 - add ASUS Zenbook Flip to noselftest list
+
+From: Marcos Paulo de Souza <mpdesouza@suse.com>
+
+commit b5d6e7ab7fe7d186878142e9fc1a05e4c3b65eb9 upstream.
+
+After commit 77b425399f6d ("Input: i8042 - use chassis info to skip
+selftest on Asus laptops"), all modern Asus laptops have the i8042
+selftest disabled. It has done by using chassys type "10" (laptop).
+
+The Asus Zenbook Flip suffers from similar suspend/resume issues, but
+it _sometimes_ work and sometimes it doesn't. Setting noselftest makes
+it work reliably. In this case, we need to add chassis type "31"
+(convertible) in order to avoid selftest in this device.
+
+Reported-by: Ludvig Norgren Guldhag <ludvigng@gmail.com>
+Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
+Link: https://lore.kernel.org/r/20210219164638.761-1-mpdesouza@suse.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/serio/i8042-x86ia64io.h |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/input/serio/i8042-x86ia64io.h
++++ b/drivers/input/serio/i8042-x86ia64io.h
+@@ -579,6 +579,10 @@ static const struct dmi_system_id i8042_
+                       DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
+               },
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
++                      DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
++              },
+       },
+       { }
+ };
diff --git a/queue-4.4/input-joydev-prevent-potential-read-overflow-in-ioctl.patch b/queue-4.4/input-joydev-prevent-potential-read-overflow-in-ioctl.patch
new file mode 100644 (file)
index 0000000..fdb2945
--- /dev/null
@@ -0,0 +1,53 @@
+From 182d679b2298d62bf42bb14b12a8067b8e17b617 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Wed, 17 Feb 2021 12:21:10 -0800
+Subject: Input: joydev - prevent potential read overflow in ioctl
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit 182d679b2298d62bf42bb14b12a8067b8e17b617 upstream.
+
+The problem here is that "len" might be less than "joydev->nabs" so the
+loops which verfy abspam[i] and keypam[] might read beyond the buffer.
+
+Fixes: 999b874f4aa3 ("Input: joydev - validate axis/button maps before clobbering current ones")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Link: https://lore.kernel.org/r/YCyzR8WvFRw4HWw6@mwanda
+[dtor: additional check for len being even in joydev_handle_JSIOCSBTNMAP]
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/joydev.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/input/joydev.c
++++ b/drivers/input/joydev.c
+@@ -448,7 +448,7 @@ static int joydev_handle_JSIOCSAXMAP(str
+       if (IS_ERR(abspam))
+               return PTR_ERR(abspam);
+-      for (i = 0; i < joydev->nabs; i++) {
++      for (i = 0; i < len && i < joydev->nabs; i++) {
+               if (abspam[i] > ABS_MAX) {
+                       retval = -EINVAL;
+                       goto out;
+@@ -472,6 +472,9 @@ static int joydev_handle_JSIOCSBTNMAP(st
+       int i;
+       int retval = 0;
++      if (len % sizeof(*keypam))
++              return -EINVAL;
++
+       len = min(len, sizeof(joydev->keypam));
+       /* Validate the map. */
+@@ -479,7 +482,7 @@ static int joydev_handle_JSIOCSBTNMAP(st
+       if (IS_ERR(keypam))
+               return PTR_ERR(keypam);
+-      for (i = 0; i < joydev->nkey; i++) {
++      for (i = 0; i < (len / 2) && i < joydev->nkey; i++) {
+               if (keypam[i] > KEY_MAX || keypam[i] < BTN_MISC) {
+                       retval = -EINVAL;
+                       goto out;
diff --git a/queue-4.4/input-xpad-add-support-for-powera-enhanced-wired-controller-for-xbox-series-x-s.patch b/queue-4.4/input-xpad-add-support-for-powera-enhanced-wired-controller-for-xbox-series-x-s.patch
new file mode 100644 (file)
index 0000000..487a3ba
--- /dev/null
@@ -0,0 +1,31 @@
+From 42ffcd1dba1796bcda386eb6f260df9fc23c90af Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@ocrete.ca>
+Date: Fri, 5 Feb 2021 11:59:08 -0800
+Subject: Input: xpad - add support for PowerA Enhanced Wired Controller for Xbox Series X|S
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Olivier CrĂȘte <olivier.crete@ocrete.ca>
+
+commit 42ffcd1dba1796bcda386eb6f260df9fc23c90af upstream.
+
+Signed-off-by: Olivier CrĂȘte <olivier.crete@ocrete.ca>
+Link: https://lore.kernel.org/r/20210204005318.615647-1-olivier.crete@collabora.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/joystick/xpad.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/input/joystick/xpad.c
++++ b/drivers/input/joystick/xpad.c
+@@ -322,6 +322,7 @@ static const struct xpad_device {
+       { 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 },
+       { 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 },
+       { 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE },
++      { 0x20d6, 0x2009, "PowerA Enhanced Wired Controller for Xbox Series X|S", 0, XTYPE_XBOXONE },
+       { 0x20d6, 0x281f, "PowerA Wired Controller For Xbox 360", 0, XTYPE_XBOX360 },
+       { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE },
+       { 0x24c6, 0x5000, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
index c20b63459b11bc018c75abe169620b963abd52b5..9db5e24f922d388f4e128bfc44cb03eeea39b5a9 100644 (file)
@@ -37,11 +37,9 @@ Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- drivers/scsi/bnx2fc/Kconfig | 1 +
+ drivers/scsi/bnx2fc/Kconfig |    1 +
  1 file changed, 1 insertion(+)
 
-diff --git a/drivers/scsi/bnx2fc/Kconfig b/drivers/scsi/bnx2fc/Kconfig
-index d401a096dfc7e..2eb2476852b11 100644
 --- a/drivers/scsi/bnx2fc/Kconfig
 +++ b/drivers/scsi/bnx2fc/Kconfig
 @@ -4,6 +4,7 @@ config SCSI_BNX2X_FCOE
@@ -52,6 +50,3 @@ index d401a096dfc7e..2eb2476852b11 100644
        select NETDEVICES
        select ETHERNET
        select NET_VENDOR_BROADCOM
--- 
-2.27.0
-
index e77aab03d7fae17383a8a3f503f3d7ff54985631..e1d3f05363321ba18d3007467b79e13481f6b226 100644 (file)
@@ -59,3 +59,8 @@ mm-memory.c-fix-potential-pte_unmap_unlock-pte-error.patch
 mm-hugetlb-fix-potential-double-free-in-hugetlb_regi.patch
 i2c-brcmstb-fix-brcmstd_send_i2c_cmd-condition.patch
 scsi-bnx2fc-fix-kconfig-warning-cnic-build-errors.patch
+block-move-sector_size-and-sector_shift-definitions-into-linux-blkdev.h.patch
+blk-settings-align-max_sectors-on-logical_block_size-boundary.patch
+input-xpad-add-support-for-powera-enhanced-wired-controller-for-xbox-series-x-s.patch
+input-joydev-prevent-potential-read-overflow-in-ioctl.patch
+input-i8042-add-asus-zenbook-flip-to-noselftest-list.patch