]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Apr 2022 12:44:50 +0000 (14:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Apr 2022 12:44:50 +0000 (14:44 +0200)
added patches:
gfs2-make-sure-fitrim-minlen-is-rounded-up-to-fs-block-size.patch
net-hns3-fix-software-vlan-talbe-of-vlan-0-inconsistent-with-hardware.patch
rtc-check-if-__rtc_read_time-was-successful.patch

queue-5.4/gfs2-make-sure-fitrim-minlen-is-rounded-up-to-fs-block-size.patch [new file with mode: 0644]
queue-5.4/net-hns3-fix-software-vlan-talbe-of-vlan-0-inconsistent-with-hardware.patch [new file with mode: 0644]
queue-5.4/rtc-check-if-__rtc_read_time-was-successful.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/gfs2-make-sure-fitrim-minlen-is-rounded-up-to-fs-block-size.patch b/queue-5.4/gfs2-make-sure-fitrim-minlen-is-rounded-up-to-fs-block-size.patch
new file mode 100644 (file)
index 0000000..1c6e187
--- /dev/null
@@ -0,0 +1,42 @@
+From 27ca8273fda398638ca994a207323a85b6d81190 Mon Sep 17 00:00:00 2001
+From: Andrew Price <anprice@redhat.com>
+Date: Tue, 22 Mar 2022 19:05:51 +0000
+Subject: gfs2: Make sure FITRIM minlen is rounded up to fs block size
+
+From: Andrew Price <anprice@redhat.com>
+
+commit 27ca8273fda398638ca994a207323a85b6d81190 upstream.
+
+Per fstrim(8) we must round up the minlen argument to the fs block size.
+The current calculation doesn't take into account devices that have a
+discard granularity and requested minlen less than 1 fs block, so the
+value can get shifted away to zero in the translation to fs blocks.
+
+The zero minlen passed to gfs2_rgrp_send_discards() then allows
+sb_issue_discard() to be called with nr_sects == 0 which returns -EINVAL
+and results in gfs2_rgrp_send_discards() returning -EIO.
+
+Make sure minlen is never < 1 fs block by taking the max of the
+requested minlen and the fs block size before comparing to the device's
+discard granularity and shifting to fs blocks.
+
+Fixes: 076f0faa764ab ("GFS2: Fix FITRIM argument handling")
+Signed-off-by: Andrew Price <anprice@redhat.com>
+Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/gfs2/rgrp.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/gfs2/rgrp.c
++++ b/fs/gfs2/rgrp.c
+@@ -1429,7 +1429,8 @@ int gfs2_fitrim(struct file *filp, void
+       start = r.start >> bs_shift;
+       end = start + (r.len >> bs_shift);
+-      minlen = max_t(u64, r.minlen,
++      minlen = max_t(u64, r.minlen, sdp->sd_sb.sb_bsize);
++      minlen = max_t(u64, minlen,
+                      q->limits.discard_granularity) >> bs_shift;
+       if (end <= start || minlen > sdp->sd_max_rg_data)
diff --git a/queue-5.4/net-hns3-fix-software-vlan-talbe-of-vlan-0-inconsistent-with-hardware.patch b/queue-5.4/net-hns3-fix-software-vlan-talbe-of-vlan-0-inconsistent-with-hardware.patch
new file mode 100644 (file)
index 0000000..48705a4
--- /dev/null
@@ -0,0 +1,38 @@
+From 7ed258f12ec5ce855f15cdfb5710361dc82fe899 Mon Sep 17 00:00:00 2001
+From: Guangbin Huang <huangguangbin2@huawei.com>
+Date: Wed, 30 Mar 2022 21:45:06 +0800
+Subject: net: hns3: fix software vlan talbe of vlan 0 inconsistent with hardware
+
+From: Guangbin Huang <huangguangbin2@huawei.com>
+
+commit 7ed258f12ec5ce855f15cdfb5710361dc82fe899 upstream.
+
+When user delete vlan 0, as driver will not delete vlan 0 for hardware in
+function hclge_set_vlan_filter_hw(), so vlan 0 in software vlan talbe should
+not be deleted.
+
+Fixes: fe4144d47eef ("net: hns3: sync VLAN filter entries when kill VLAN ID failed")
+Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+@@ -8344,11 +8344,11 @@ int hclge_set_vlan_filter(struct hnae3_h
+       }
+       if (!ret) {
+-              if (is_kill)
+-                      hclge_rm_vport_vlan_table(vport, vlan_id, false);
+-              else
++              if (!is_kill)
+                       hclge_add_vport_vlan_table(vport, vlan_id,
+                                                  writen_to_tbl);
++              else if (is_kill && vlan_id != 0)
++                      hclge_rm_vport_vlan_table(vport, vlan_id, false);
+       } else if (is_kill) {
+               /* when remove hw vlan filter failed, record the vlan id,
+                * and try to remove it from hw later, to be consistence
diff --git a/queue-5.4/rtc-check-if-__rtc_read_time-was-successful.patch b/queue-5.4/rtc-check-if-__rtc_read_time-was-successful.patch
new file mode 100644 (file)
index 0000000..0c8eaea
--- /dev/null
@@ -0,0 +1,54 @@
+From 915593a7a663b2ad08b895a5f3ba8b19d89d4ebf Mon Sep 17 00:00:00 2001
+From: Tom Rix <trix@redhat.com>
+Date: Sat, 26 Mar 2022 12:42:36 -0700
+Subject: rtc: check if __rtc_read_time was successful
+
+From: Tom Rix <trix@redhat.com>
+
+commit 915593a7a663b2ad08b895a5f3ba8b19d89d4ebf upstream.
+
+Clang static analysis reports this issue
+interface.c:810:8: warning: Passed-by-value struct
+  argument contains uninitialized data
+  now = rtc_tm_to_ktime(tm);
+      ^~~~~~~~~~~~~~~~~~~
+
+tm is set by a successful call to __rtc_read_time()
+but its return status is not checked.  Check if
+it was successful before setting the enabled flag.
+Move the decl of err to function scope.
+
+Fixes: 2b2f5ff00f63 ("rtc: interface: ignore expired timers when enqueuing new timers")
+Signed-off-by: Tom Rix <trix@redhat.com>
+Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+Link: https://lore.kernel.org/r/20220326194236.2916310-1-trix@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/rtc/interface.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/rtc/interface.c
++++ b/drivers/rtc/interface.c
+@@ -793,9 +793,13 @@ static int rtc_timer_enqueue(struct rtc_
+       struct timerqueue_node *next = timerqueue_getnext(&rtc->timerqueue);
+       struct rtc_time tm;
+       ktime_t now;
++      int err;
++
++      err = __rtc_read_time(rtc, &tm);
++      if (err)
++              return err;
+       timer->enabled = 1;
+-      __rtc_read_time(rtc, &tm);
+       now = rtc_tm_to_ktime(tm);
+       /* Skip over expired timers */
+@@ -809,7 +813,6 @@ static int rtc_timer_enqueue(struct rtc_
+       trace_rtc_timer_enqueue(timer);
+       if (!next || ktime_before(timer->node.expires, next->expires)) {
+               struct rtc_wkalrm alarm;
+-              int err;
+               alarm.time = rtc_ktime_to_tm(timer->node.expires);
+               alarm.enabled = 1;
index d08c5546710c7a3ffc4d582001efe82f5c8ea888..18d5b1a48908d0a5c34ba043259e445ba557024b 100644 (file)
@@ -341,3 +341,6 @@ xarray-fix-xas_create_range-when-multi-order-entry-present.patch
 can-mcba_usb-mcba_usb_start_xmit-fix-double-dev_kfree_skb-in-error-path.patch
 can-mcba_usb-properly-check-endpoint-type.patch
 xarray-update-the-lru-list-in-xas_split.patch
+rtc-check-if-__rtc_read_time-was-successful.patch
+gfs2-make-sure-fitrim-minlen-is-rounded-up-to-fs-block-size.patch
+net-hns3-fix-software-vlan-talbe-of-vlan-0-inconsistent-with-hardware.patch