]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2022 10:05:39 +0000 (11:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2022 10:05:39 +0000 (11:05 +0100)
added patches:
net-ieee802154-fix-error-return-code-in-dgram_bind.patch

queue-5.4/net-ieee802154-fix-error-return-code-in-dgram_bind.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/net-ieee802154-fix-error-return-code-in-dgram_bind.patch b/queue-5.4/net-ieee802154-fix-error-return-code-in-dgram_bind.patch
new file mode 100644 (file)
index 0000000..1ac36c7
--- /dev/null
@@ -0,0 +1,35 @@
+From 444d8ad4916edec8a9fc684e841287db9b1e999f Mon Sep 17 00:00:00 2001
+From: Wei Yongjun <weiyongjun1@huawei.com>
+Date: Mon, 19 Sep 2022 16:08:30 +0000
+Subject: net: ieee802154: fix error return code in dgram_bind()
+
+From: Wei Yongjun <weiyongjun1@huawei.com>
+
+commit 444d8ad4916edec8a9fc684e841287db9b1e999f upstream.
+
+Fix to return error code -EINVAL from the error handling
+case instead of 0, as done elsewhere in this function.
+
+Fixes: 94160108a70c ("net/ieee802154: fix uninit value bug in dgram_sendmsg")
+Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
+Link: https://lore.kernel.org/r/20220919160830.1436109-1-weiyongjun@huaweicloud.com
+Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ieee802154/socket.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/net/ieee802154/socket.c
++++ b/net/ieee802154/socket.c
+@@ -507,8 +507,10 @@ static int dgram_bind(struct sock *sk, s
+       if (err < 0)
+               goto out;
+-      if (addr->family != AF_IEEE802154)
++      if (addr->family != AF_IEEE802154) {
++              err = -EINVAL;
+               goto out;
++      }
+       ieee802154_addr_from_sa(&haddr, &addr->addr);
+       dev = ieee802154_get_dev(sock_net(sk), &haddr);
index c5012faa0e6ef8d2efd7d329343908c0aac0f7ac..f22708a485734d832af192d6fcc263a89f465833 100644 (file)
@@ -27,3 +27,4 @@ xen-gntdev-don-t-ignore-kernel-unmapping-error.patch
 xen-gntdev-prevent-leaking-grants.patch
 cgroup-v1-add-disabled-controller-check-in-cgroup1_parse_param.patch
 mm-hugetlb-take-hugetlb_lock-before-decrementing-h-resv_huge_pages.patch
+net-ieee802154-fix-error-return-code-in-dgram_bind.patch