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;
skb = skb_recv_datagram(sk, flags, noblock, &err);
if (!skb)
return err;
---
-2.34.1
-
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);
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);
}
}
static int isotp_release(struct socket *sock)
---
-2.34.1
-
--- /dev/null
+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);
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