[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200618.075456.550840877226409223.davem@davemloft.net>
Date: Thu, 18 Jun 2020 07:54:56 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: gaurav1086@...il.com
Cc: jhs@...atatu.com, xiyou.wangcong@...il.com, jiri@...nulli.us,
kuba@...nel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [net/sched] Fix null pointer deref skb in tc_ctl_action
From: Gaurav Singh <gaurav1086@...il.com>
Date: Wed, 17 Jun 2020 21:43:28 -0400
> Add null check for skb
>
> Signed-off-by: Gaurav Singh <gaurav1086@...il.com>
> ---
> net/sched/act_api.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index 8ac7eb0a8309..fd584821d75a 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -1473,9 +1473,12 @@ static const struct nla_policy tcaa_policy[TCA_ROOT_MAX + 1] = {
> static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n,
> struct netlink_ext_ack *extack)
> {
> + if (!skb)
> + return 0;
> +
> struct net *net = sock_net(skb->sk);
You're adding code before variable declarations, this is not correct.
I find your work to be very rushed and sloppy, please take your time
and submit well formed and tested changes.
Thank you.
Powered by blists - more mailing lists