Re: [PATCH net-next 1/6] nexthop: dereference nh only once in nexthop_select_path

2020-05-19 Thread Nikolay Aleksandrov
On 19/05/2020 11:48, Nikolay Aleksandrov wrote: > On 19/05/2020 06:25, David Ahern wrote: >> On 5/18/20 8:14 PM, Roopa Prabhu wrote: >>> From: Nikolay Aleksandrov >>> >>> the ->nh pointer might become suddenly null while we're selecting the >>> path and we may dereference it. Dereference it only o

Re: [PATCH net-next 1/6] nexthop: dereference nh only once in nexthop_select_path

2020-05-19 Thread Nikolay Aleksandrov
On 19/05/2020 06:25, David Ahern wrote: > On 5/18/20 8:14 PM, Roopa Prabhu wrote: >> From: Nikolay Aleksandrov >> >> the ->nh pointer might become suddenly null while we're selecting the >> path and we may dereference it. Dereference it only once in the >> beginning and use that if it's not null,

Re: [PATCH net-next 1/6] nexthop: dereference nh only once in nexthop_select_path

2020-05-18 Thread David Ahern
On 5/18/20 8:14 PM, Roopa Prabhu wrote: > From: Nikolay Aleksandrov > > the ->nh pointer might become suddenly null while we're selecting the > path and we may dereference it. Dereference it only once in the > beginning and use that if it's not null, we rely on the refcounting and > rcu to protec

[PATCH net-next 1/6] nexthop: dereference nh only once in nexthop_select_path

2020-05-18 Thread Roopa Prabhu
From: Nikolay Aleksandrov the ->nh pointer might become suddenly null while we're selecting the path and we may dereference it. Dereference it only once in the beginning and use that if it's not null, we rely on the refcounting and rcu to protect against use-after-free. (This is needed for later