]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Jan 2024 22:22:58 +0000 (14:22 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Jan 2024 22:22:58 +0000 (14:22 -0800)
added patches:
btrfs-defrag-reject-unknown-flags-of-btrfs_ioctl_defrag_range_args.patch
btrfs-don-t-warn-if-discard-range-is-not-aligned-to-sector.patch
gpiolib-acpi-ignore-touchpad-wakeup-on-gpd-g1619-04.patch
netfilter-nf_tables-reject-queue-drop-verdict-parameters.patch

queue-4.19/btrfs-defrag-reject-unknown-flags-of-btrfs_ioctl_defrag_range_args.patch [new file with mode: 0644]
queue-4.19/btrfs-don-t-warn-if-discard-range-is-not-aligned-to-sector.patch [new file with mode: 0644]
queue-4.19/gpiolib-acpi-ignore-touchpad-wakeup-on-gpd-g1619-04.patch [new file with mode: 0644]
queue-4.19/net-fec-fix-the-unhandled-context-fault-from-smmu.patch
queue-4.19/netfilter-nf_tables-reject-queue-drop-verdict-parameters.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/btrfs-defrag-reject-unknown-flags-of-btrfs_ioctl_defrag_range_args.patch b/queue-4.19/btrfs-defrag-reject-unknown-flags-of-btrfs_ioctl_defrag_range_args.patch
new file mode 100644 (file)
index 0000000..9d85608
--- /dev/null
@@ -0,0 +1,54 @@
+From 173431b274a9a54fc10b273b46e67f46bcf62d2e Mon Sep 17 00:00:00 2001
+From: Qu Wenruo <wqu@suse.com>
+Date: Wed, 10 Jan 2024 08:58:26 +1030
+Subject: btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args
+
+From: Qu Wenruo <wqu@suse.com>
+
+commit 173431b274a9a54fc10b273b46e67f46bcf62d2e upstream.
+
+Add extra sanity check for btrfs_ioctl_defrag_range_args::flags.
+
+This is not really to enhance fuzzing tests, but as a preparation for
+future expansion on btrfs_ioctl_defrag_range_args.
+
+In the future we're going to add new members, allowing more fine tuning
+for btrfs defrag.  Without the -ENONOTSUPP error, there would be no way
+to detect if the kernel supports those new defrag features.
+
+CC: stable@vger.kernel.org # 4.14+
+Reviewed-by: Filipe Manana <fdmanana@suse.com>
+Signed-off-by: Qu Wenruo <wqu@suse.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/btrfs/ioctl.c           |    4 ++++
+ include/uapi/linux/btrfs.h |    3 +++
+ 2 files changed, 7 insertions(+)
+
+--- a/fs/btrfs/ioctl.c
++++ b/fs/btrfs/ioctl.c
+@@ -3037,6 +3037,10 @@ static int btrfs_ioctl_defrag(struct fil
+                               kfree(range);
+                               goto out;
+                       }
++                      if (range->flags & ~BTRFS_DEFRAG_RANGE_FLAGS_SUPP) {
++                              ret = -EOPNOTSUPP;
++                              goto out;
++                      }
+                       /* compression requires us to start the IO */
+                       if ((range->flags & BTRFS_DEFRAG_RANGE_COMPRESS)) {
+                               range->flags |= BTRFS_DEFRAG_RANGE_START_IO;
+--- a/include/uapi/linux/btrfs.h
++++ b/include/uapi/linux/btrfs.h
+@@ -538,6 +538,9 @@ struct btrfs_ioctl_clone_range_args {
+  */
+ #define BTRFS_DEFRAG_RANGE_COMPRESS 1
+ #define BTRFS_DEFRAG_RANGE_START_IO 2
++#define BTRFS_DEFRAG_RANGE_FLAGS_SUPP (BTRFS_DEFRAG_RANGE_COMPRESS |          \
++                                       BTRFS_DEFRAG_RANGE_START_IO)
++
+ struct btrfs_ioctl_defrag_range_args {
+       /* start of the defrag operation */
+       __u64 start;
diff --git a/queue-4.19/btrfs-don-t-warn-if-discard-range-is-not-aligned-to-sector.patch b/queue-4.19/btrfs-don-t-warn-if-discard-range-is-not-aligned-to-sector.patch
new file mode 100644 (file)
index 0000000..78ae8ca
--- /dev/null
@@ -0,0 +1,37 @@
+From a208b3f132b48e1f94f620024e66fea635925877 Mon Sep 17 00:00:00 2001
+From: David Sterba <dsterba@suse.com>
+Date: Mon, 15 Jan 2024 20:30:26 +0100
+Subject: btrfs: don't warn if discard range is not aligned to sector
+
+From: David Sterba <dsterba@suse.com>
+
+commit a208b3f132b48e1f94f620024e66fea635925877 upstream.
+
+There's a warning in btrfs_issue_discard() when the range is not aligned
+to 512 bytes, originally added in 4d89d377bbb0 ("btrfs:
+btrfs_issue_discard ensure offset/length are aligned to sector
+boundaries"). We can't do sub-sector writes anyway so the adjustment is
+the only thing that we can do and the warning is unnecessary.
+
+CC: stable@vger.kernel.org # 4.19+
+Reported-by: syzbot+4a4f1eba14eb5c3417d1@syzkaller.appspotmail.com
+Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
+Reviewed-by: Anand Jain <anand.jain@oracle.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/btrfs/extent-tree.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/btrfs/extent-tree.c
++++ b/fs/btrfs/extent-tree.c
+@@ -1899,7 +1899,8 @@ static int btrfs_issue_discard(struct bl
+       u64 bytes_left, end;
+       u64 aligned_start = ALIGN(start, 1 << 9);
+-      if (WARN_ON(start != aligned_start)) {
++      /* Adjust the range to be aligned to 512B sectors if necessary. */
++      if (start != aligned_start) {
+               len -= aligned_start - start;
+               len = round_down(len, 1 << 9);
+               start = aligned_start;
diff --git a/queue-4.19/gpiolib-acpi-ignore-touchpad-wakeup-on-gpd-g1619-04.patch b/queue-4.19/gpiolib-acpi-ignore-touchpad-wakeup-on-gpd-g1619-04.patch
new file mode 100644 (file)
index 0000000..a2a12c1
--- /dev/null
@@ -0,0 +1,46 @@
+From 805c74eac8cb306dc69b87b6b066ab4da77ceaf1 Mon Sep 17 00:00:00 2001
+From: Mario Limonciello <mario.limonciello@amd.com>
+Date: Wed, 17 Jan 2024 08:29:42 -0600
+Subject: gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+commit 805c74eac8cb306dc69b87b6b066ab4da77ceaf1 upstream.
+
+Spurious wakeups are reported on the GPD G1619-04 which
+can be absolved by programming the GPIO to ignore wakeups.
+
+Cc: stable@vger.kernel.org
+Reported-and-tested-by: George Melikov <mail@gmelikov.ru>
+Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3073
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpio/gpiolib-acpi.c |   14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+--- a/drivers/gpio/gpiolib-acpi.c
++++ b/drivers/gpio/gpiolib-acpi.c
+@@ -1427,6 +1427,20 @@ static const struct dmi_system_id gpioli
+                       .ignore_wake = "INT33FF:01@0",
+               },
+       },
++      {
++              /*
++               * Spurious wakeups from TP_ATTN# pin
++               * Found in BIOS 0.35
++               * https://gitlab.freedesktop.org/drm/amd/-/issues/3073
++               */
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "GPD"),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "G1619-04"),
++              },
++              .driver_data = &(struct acpi_gpiolib_dmi_quirk) {
++                      .ignore_wake = "PNP0C50:00@8",
++              },
++      },
+       {} /* Terminating entry */
+ };
index 4225e7d8bb51da49789ecdd085216e0f5f7cb3ec..5f08389328e6471d92c828c7cd9083514133f819 100644 (file)
@@ -30,14 +30,12 @@ Link: https://lore.kernel.org/r/20240123165141.2008104-1-shenwei.wang@nxp.com
 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- drivers/net/ethernet/freescale/fec_main.c | 2 ++
+ drivers/net/ethernet/freescale/fec_main.c |    2 ++
  1 file changed, 2 insertions(+)
 
-diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
-index e4162c2271e3..9c4c892bfc83 100644
 --- a/drivers/net/ethernet/freescale/fec_main.c
 +++ b/drivers/net/ethernet/freescale/fec_main.c
-@@ -1798,6 +1798,7 @@ static void fec_enet_adjust_link(struct net_device *ndev)
+@@ -1798,6 +1798,7 @@ static void fec_enet_adjust_link(struct
  
                /* if any of the above changed restart the FEC */
                if (status_change) {
@@ -45,7 +43,7 @@ index e4162c2271e3..9c4c892bfc83 100644
                        napi_disable(&fep->napi);
                        netif_tx_lock_bh(ndev);
                        fec_restart(ndev);
-@@ -1807,6 +1808,7 @@ static void fec_enet_adjust_link(struct net_device *ndev)
+@@ -1807,6 +1808,7 @@ static void fec_enet_adjust_link(struct
                }
        } else {
                if (fep->link) {
@@ -53,6 +51,3 @@ index e4162c2271e3..9c4c892bfc83 100644
                        napi_disable(&fep->napi);
                        netif_tx_lock_bh(ndev);
                        fec_stop(ndev);
--- 
-2.43.0
-
diff --git a/queue-4.19/netfilter-nf_tables-reject-queue-drop-verdict-parameters.patch b/queue-4.19/netfilter-nf_tables-reject-queue-drop-verdict-parameters.patch
new file mode 100644 (file)
index 0000000..51871ac
--- /dev/null
@@ -0,0 +1,69 @@
+From f342de4e2f33e0e39165d8639387aa6c19dff660 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Sat, 20 Jan 2024 22:50:04 +0100
+Subject: netfilter: nf_tables: reject QUEUE/DROP verdict parameters
+
+From: Florian Westphal <fw@strlen.de>
+
+commit f342de4e2f33e0e39165d8639387aa6c19dff660 upstream.
+
+This reverts commit e0abdadcc6e1.
+
+core.c:nf_hook_slow assumes that the upper 16 bits of NF_DROP
+verdicts contain a valid errno, i.e. -EPERM, -EHOSTUNREACH or similar,
+or 0.
+
+Due to the reverted commit, its possible to provide a positive
+value, e.g. NF_ACCEPT (1), which results in use-after-free.
+
+Its not clear to me why this commit was made.
+
+NF_QUEUE is not used by nftables; "queue" rules in nftables
+will result in use of "nft_queue" expression.
+
+If we later need to allow specifiying errno values from userspace
+(do not know why), this has to call NF_DROP_GETERR and check that
+"err <= 0" holds true.
+
+Fixes: e0abdadcc6e1 ("netfilter: nf_tables: accept QUEUE/DROP verdict parameters")
+Cc: stable@vger.kernel.org
+Reported-by: Notselwyn <notselwyn@pwning.tech>
+Signed-off-by: Florian Westphal <fw@strlen.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/netfilter/nf_tables_api.c |   16 ++++++----------
+ 1 file changed, 6 insertions(+), 10 deletions(-)
+
+--- a/net/netfilter/nf_tables_api.c
++++ b/net/netfilter/nf_tables_api.c
+@@ -7341,16 +7341,10 @@ static int nft_verdict_init(const struct
+       data->verdict.code = ntohl(nla_get_be32(tb[NFTA_VERDICT_CODE]));
+       switch (data->verdict.code) {
+-      default:
+-              switch (data->verdict.code & NF_VERDICT_MASK) {
+-              case NF_ACCEPT:
+-              case NF_DROP:
+-              case NF_QUEUE:
+-                      break;
+-              default:
+-                      return -EINVAL;
+-              }
+-              /* fall through */
++      case NF_ACCEPT:
++      case NF_DROP:
++      case NF_QUEUE:
++              break;
+       case NFT_CONTINUE:
+       case NFT_BREAK:
+       case NFT_RETURN:
+@@ -7370,6 +7364,8 @@ static int nft_verdict_init(const struct
+               data->verdict.chain = chain;
+               break;
++      default:
++              return -EINVAL;
+       }
+       desc->len = sizeof(data->verdict);
index 45643eb211b0e6aa47ddd88e0702e3d51222a720..61c5d1634c1421443cfaa31d4f3b3e169f1bfd37 100644 (file)
@@ -33,3 +33,7 @@ net-mlx5e-fix-a-double-free-in-arfs_create_groups.patch
 netfilter-nf_tables-restrict-anonymous-set-and-map-n.patch
 fjes-fix-memleaks-in-fjes_hw_setup.patch
 net-fec-fix-the-unhandled-context-fault-from-smmu.patch
+btrfs-don-t-warn-if-discard-range-is-not-aligned-to-sector.patch
+btrfs-defrag-reject-unknown-flags-of-btrfs_ioctl_defrag_range_args.patch
+netfilter-nf_tables-reject-queue-drop-verdict-parameters.patch
+gpiolib-acpi-ignore-touchpad-wakeup-on-gpd-g1619-04.patch