]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Apr 2022 07:48:20 +0000 (09:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Apr 2022 07:48:20 +0000 (09:48 +0200)
added patches:
proc-bootconfig-add-null-pointer-check.patch

queue-5.15/can-isotp-return-eaddrnotavail-when-reading-from-unb.patch
queue-5.15/can-isotp-support-msg_trunc-flag-when-reading-from-s.patch
queue-5.15/proc-bootconfig-add-null-pointer-check.patch [new file with mode: 0644]
queue-5.15/series

index 24b0da7220361a757d6c236ca79f5a7ef57ed794..9ac7b03d7eaf3b6ed25a93a4ce632382431c4e18 100644 (file)
@@ -20,14 +20,12 @@ Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
 Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- net/can/isotp.c | 4 ++++
+ net/can/isotp.c |    4 ++++
  1 file changed, 4 insertions(+)
 
-diff --git a/net/can/isotp.c b/net/can/isotp.c
-index 9de6c3daed79..9ea179a6aeb0 100644
 --- a/net/can/isotp.c
 +++ b/net/can/isotp.c
-@@ -1045,12 +1045,16 @@ static int isotp_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
+@@ -1005,12 +1005,16 @@ static int isotp_recvmsg(struct socket *
  {
        struct sock *sk = sock->sk;
        struct sk_buff *skb;
@@ -44,6 +42,3 @@ index 9de6c3daed79..9ea179a6aeb0 100644
        skb = skb_recv_datagram(sk, flags, noblock, &err);
        if (!skb)
                return err;
--- 
-2.34.1
-
index 176e7e5f9fed8ff4b5f49411f9d03d3d639530fc..fa176dc068c0e1cbc6647a09d9b1a609dfbc1f6b 100644 (file)
@@ -19,14 +19,12 @@ Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
 Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- net/can/isotp.c | 27 +++++++++++++++------------
+ net/can/isotp.c |   27 +++++++++++++++------------
  1 file changed, 15 insertions(+), 12 deletions(-)
 
-diff --git a/net/can/isotp.c b/net/can/isotp.c
-index 9ea179a6aeb0..fabf8c66a38c 100644
 --- a/net/can/isotp.c
 +++ b/net/can/isotp.c
-@@ -1046,29 +1046,28 @@ static int isotp_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
+@@ -1006,29 +1006,28 @@ static int isotp_recvmsg(struct socket *
        struct sock *sk = sock->sk;
        struct sk_buff *skb;
        struct isotp_sock *so = isotp_sk(sk);
@@ -66,7 +64,7 @@ index 9ea179a6aeb0..fabf8c66a38c 100644
  
        sock_recv_timestamp(msg, sk, skb);
  
-@@ -1078,9 +1077,13 @@ static int isotp_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
+@@ -1038,9 +1037,13 @@ static int isotp_recvmsg(struct socket *
                memcpy(msg->msg_name, skb->cb, msg->msg_namelen);
        }
  
@@ -81,6 +79,3 @@ index 9ea179a6aeb0..fabf8c66a38c 100644
  }
  
  static int isotp_release(struct socket *sock)
--- 
-2.34.1
-
diff --git a/queue-5.15/proc-bootconfig-add-null-pointer-check.patch b/queue-5.15/proc-bootconfig-add-null-pointer-check.patch
new file mode 100644 (file)
index 0000000..f15e0eb
--- /dev/null
@@ -0,0 +1,36 @@
+From bed5b60bf67ccd8957b8c0558fead30c4a3f5d3f Mon Sep 17 00:00:00 2001
+From: Lv Ruyi <lv.ruyi@zte.com.cn>
+Date: Tue, 29 Mar 2022 10:40:04 +0000
+Subject: proc: bootconfig: Add null pointer check
+
+From: Lv Ruyi <lv.ruyi@zte.com.cn>
+
+commit bed5b60bf67ccd8957b8c0558fead30c4a3f5d3f upstream.
+
+kzalloc is a memory allocation function which can return NULL when some
+internal memory errors happen. It is safer to add null pointer check.
+
+Link: https://lkml.kernel.org/r/20220329104004.2376879-1-lv.ruyi@zte.com.cn
+
+Cc: stable@vger.kernel.org
+Fixes: c1a3c36017d4 ("proc: bootconfig: Add /proc/bootconfig to show boot config list")
+Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
+Reported-by: Zeal Robot <zealci@zte.com.cn>
+Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
+Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/proc/bootconfig.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/fs/proc/bootconfig.c
++++ b/fs/proc/bootconfig.c
+@@ -32,6 +32,8 @@ static int __init copy_xbc_key_value_lis
+       int ret = 0;
+       key = kzalloc(XBC_KEYLEN_MAX, GFP_KERNEL);
++      if (!key)
++              return -ENOMEM;
+       xbc_for_each_key_value(leaf, val) {
+               ret = xbc_node_compose_key(leaf, key, XBC_KEYLEN_MAX);
index 93ac816fd30ae59e0bec4d59ec273d7c9f2a840c..722c3055414d3a7d7ac3788536e5e702a8093f51 100644 (file)
@@ -860,3 +860,4 @@ vhost-handle-error-while-adding-split-ranges-to-iotlb.patch
 spi-fix-tegra-qspi-example.patch
 platform-chrome-cros_ec_typec-check-for-ec-device.patch
 can-isotp-restore-accidentally-removed-msg_peek-feat.patch
+proc-bootconfig-add-null-pointer-check.patch