[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpXG-3XBxKxPR5s8jyZEZthaBaG73No3DOqr78aWNn1c3w@mail.gmail.com>
Date: Wed, 4 Dec 2019 09:29:56 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Taehee Yoo <ap420073@...il.com>
Cc: David Miller <davem@...emloft.net>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
treeze.taeung@...il.com
Subject: Re: [net PATCH] hsr: fix a NULL pointer dereference in hsr_dev_xmit()
On Sat, Nov 30, 2019 at 6:24 AM Taehee Yoo <ap420073@...il.com> wrote:
>
> hsr_dev_xmit() calls hsr_port_get_hsr() to find master node and that would
> return NULL if master node is not existing in the list.
> But hsr_dev_xmit() doesn't check return pointer so a NULL dereference
> could occur.
>
> In the TX datapath, there is no rcu_read_lock() so this patch adds missing
> rcu_read_lock() in the hsr_dev_xmit() too.
Just a correction:
The TX path _has_ RCU read lock, but it harms nothing to take it again.
[...]
>
> Fixes: 311633b60406 ("hsr: switch ->dellink() to ->ndo_uninit()")
> Signed-off-by: Taehee Yoo <ap420073@...il.com>
This fix is correct. There is no other way to workaround this RCU
rule, checking against NULL is the only way to fix RCU reader
races, so:
Acked-by: Cong Wang <xiyou.wangcong@...il.com>
Taehee, you might have to resend this with my Acked-by as David
probably already drops it from patchwork.
Thanks.
Powered by blists - more mailing lists