Re: [PATCH net] ipv4: Fix use-after-free when flushing FIB tables

2017-12-19 Thread David Miller
From: Ido Schimmel Date: Tue, 19 Dec 2017 20:49:13 +0200 > How about I'll send v2 with a comment and then we can try Alex's > suggestion in net-next? Sounds good.

Re: [PATCH net] ipv4: Fix use-after-free when flushing FIB tables

2017-12-19 Thread Ido Schimmel
On Tue, Dec 19, 2017 at 09:34:16AM -0800, Alexander Duyck wrote: > That seems like unneeded complexity when the issue is just the order > that these were created in versus the order they are freed in. As long > as we always destroy the one containing the alias before the one that > has the actual d

Re: [PATCH net] ipv4: Fix use-after-free when flushing FIB tables

2017-12-19 Thread Alexander Duyck
On Tue, Dec 19, 2017 at 8:32 AM, David Miller wrote: > From: Ido Schimmel > Date: Mon, 18 Dec 2017 10:13:20 +0200 > >> Since commit 0ddcf43d5d4a ("ipv4: FIB Local/MAIN table collapse") the >> local table uses the same trie allocated for the main table when custom >> rules are not in use. >> >> Wh

Re: [PATCH net] ipv4: Fix use-after-free when flushing FIB tables

2017-12-19 Thread David Miller
From: Ido Schimmel Date: Mon, 18 Dec 2017 10:13:20 +0200 > Since commit 0ddcf43d5d4a ("ipv4: FIB Local/MAIN table collapse") the > local table uses the same trie allocated for the main table when custom > rules are not in use. > > When a net namespace is dismantled, the main table is flushed and

[PATCH net] ipv4: Fix use-after-free when flushing FIB tables

2017-12-18 Thread Ido Schimmel
Since commit 0ddcf43d5d4a ("ipv4: FIB Local/MAIN table collapse") the local table uses the same trie allocated for the main table when custom rules are not in use. When a net namespace is dismantled, the main table is flushed and freed (via an RCU callback) before the local table. In case the call