Re: [PATCH] net/ipv6: Skip policy check to improve compliance

2019-03-11 Thread Herbert Xu
rable to DoS attacks. Please provide a rationale why such packets should *not* be dropped based on a relevant RFC document. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] net: xfrm: Fix potential oops in xfrm_user_rcv_msg and array out of bounds

2019-03-04 Thread Herbert Xu
if (type >= XFRM_MSG_MAX) > return -EINVAL; Your patch is wrong. Please check the definition of XFRM_MSG_MAX. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] xfrm: policy: Fix out-of-bound array accesses in __xfrm_policy_unlink

2019-02-27 Thread Herbert Xu
ete > --> __xfrm_policy_unlink //access policy_count[dir], trigger out of > range access > > Add xfrm_policy_id2dir check in verify_newpolicy_info, make sure the computed > dir is > valid, to fix the issue. > > Reported-by: Hulk Robot > F

Re: [PATCH v2] xfrm: policy: Fix possible user after free in __xfrm_policy_unlink

2019-02-27 Thread Herbert Xu
dir) || > + (xfrm_policy_id2dir(p->index) >= XFRM_POLICY_MAX))) Please just check xfrm_policy_id2dir(p->index) != p->dir Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] xfrm: policy: Fix possible user after free in __xfrm_policy_unlink

2019-02-27 Thread Herbert Xu
rify_newpolicy_info. So please fix it there. Thanks! -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2] xfrm: correctly check policy index in verify_newpolicy_info

2019-02-25 Thread Herbert Xu
cy_unlink and not here. Your patch makes no sense. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[PATCH] ila: Fix uninitialised return value in ila_xlat_nl_cmd_flush

2019-02-22 Thread Herbert Xu
lush. Reported-by: Dan Carpenter Fixes: 6c4128f65857 ("rhashtable: Remove obsolete...") Signed-off-by: Herbert Xu diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c index ae6cd4cef8db..79d2e43c05c5 100644 --- a/net/ipv6/ila/ila_xlat.c +++ b/net/ipv6/ila/ila_xlat.c @@ -383,7 +383,

Re: KASAN: use-after-free Read in br_mdb_ip_get

2019-02-20 Thread Herbert Xu
#x27;ve looked through the rhashtable code in question and everything looks OK. So I suspect some earlier corruption has occured to cause this anomalous result. Is it possible to collect earlier alloc/free stack traces on the object in question? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [v3 PATCH 0/4] mac80211: Fix incorrect usage of rhashtable walk API

2019-02-18 Thread Herbert Xu
even just appending "(v3)" to > the subject of the cover letter would've fixed that... Noted. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] lib/test_rhashtable: fix spelling mistake "existant" -> "existent"

2019-02-18 Thread Herbert Xu
On Sun, Feb 17, 2019 at 10:52:09PM +, Colin King wrote: > From: Colin Ian King > > There are spelling mistakes in warning macro messages. Fix them. > > Signed-off-by: Colin Ian King Acked-by: Herbert Xu -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert

Re: [PATCH 2/4] mac80211: Free mpath object when rhashtable insertion fails

2019-02-14 Thread Herbert Xu
d not to do this in my patch as it's not directly related to the kfree issue. But I agree that this makes more sense and we should make that change in another patch. Thanks! -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[PATCH 4/4] rhashtable: Remove obsolete rhashtable_walk_init function

2019-02-14 Thread Herbert Xu
The rhashtable_walk_init function has been obsolete for more than two years. This patch finally converts its last users over to rhashtable_walk_enter and removes it. Signed-off-by: Herbert Xu --- include/linux/rhashtable.h |8 lib/rhashtable.c |2 +- lib

[PATCH 2/4] mac80211: Free mpath object when rhashtable insertion fails

2019-02-14 Thread Herbert Xu
When rhashtable insertion fails the mesh table code doesn't free the now-orphan mesh path object. This patch fixes that. Signed-off-by: Herbert Xu --- net/mac80211/mesh_pathtbl.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/net/mac

[PATCH 1/4] mac80211: Use linked list instead of rhashtable walk for mesh tables

2019-02-14 Thread Herbert Xu
s the walk list modifications. In fact the previous code was buggy as the removals can race with each other, potentially resulting in a double-free. Signed-off-by: Herbert Xu --- net/mac80211/mesh.h |6 + net/mac80211/mesh_pathtbl.c | 138 +++- 2 fi

[PATCH 3/4] mac80211: Use rhashtable_lookup_get_insert_fast instead of racy code

2019-02-14 Thread Herbert Xu
directly return the mathcing object. Signed-off-by: Herbert Xu --- net/mac80211/mesh_pathtbl.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index c3a7396fb955..8902395e406e 100644 --- a

[v3 PATCH 0/4] mac80211: Fix incorrect usage of rhashtable walk API

2019-02-14 Thread Herbert Xu
fails (which can occur due to OOM). The third patch is a code-cleanup to mac80211 while the last patch removes an obsolete rhashtable API. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 2/4] mac80211: Free mpath object when rhashtable insertion fails

2019-02-14 Thread Herbert Xu
On Wed, Feb 13, 2019 at 04:04:29PM +0100, Johannes Berg wrote: > On Wed, 2019-02-13 at 22:39 +0800, Herbert Xu wrote: > > + if (ret != -EEXIST) > > return ERR_PTR(ret); > > Surely that should still be "if (ret && ret != -EEXIST)" otherwise yo

[PATCH 4/4] rhashtable: Remove obsolete rhashtable_walk_init function

2019-02-13 Thread Herbert Xu
The rhashtable_walk_init function has been obsolete for more than two years. This patch finally converts its last users over to rhashtable_walk_enter and removes it. Signed-off-by: Herbert Xu --- include/linux/rhashtable.h |8 lib/rhashtable.c |2 +- lib

[PATCH 2/4] mac80211: Free mpath object when rhashtable insertion fails

2019-02-13 Thread Herbert Xu
When rhashtable insertion fails the mesh table code doesn't free the now-orphan mesh path object. This patch fixes that. Signed-off-by: Herbert Xu --- net/mac80211/mesh_pathtbl.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/net/mac80211/mesh_pathtb

[PATCH 1/4] mac80211: Use linked list instead of rhashtable walk for mesh tables

2019-02-13 Thread Herbert Xu
s the walk list modifications. In fact the previous code was buggy as the removals can race with each other, potentially resulting in a double-free. Signed-off-by: Herbert Xu --- net/mac80211/mesh.h |6 + net/mac80211/mesh_pathtbl.c | 138 +++- 2 fi

[v2 PATCH 0/4] mac80211: Fix incorrect usage of rhashtable walk API

2019-02-13 Thread Herbert Xu
moves an obsolete rhashtable API. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[PATCH 3/4] mac80211: Use rhashtable_lookup_get_insert_fast instead of racy code

2019-02-13 Thread Herbert Xu
directly return the mathcing object. Signed-off-by: Herbert Xu --- net/mac80211/mesh_pathtbl.c | 31 ++- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index db5a1aef22db..8902395e406e 100644

Re: [PATCH 1/2] mac80211: Use linked list instead of rhashtable walk for mesh tables

2019-02-13 Thread Herbert Xu
On Wed, Feb 13, 2019 at 01:16:13PM +0800, Herbert Xu wrote: > The mesh table code walks over hash tables for two purposes. First of > all it's used as part of a netlink dump process, but it is also used > for looking up entries to delete using criteria other than the hash > key

Re: [PATCH 2/2] mac80211: Free mpath object when rhashtable insertion fails (fwd)

2019-02-13 Thread Herbert Xu
r is not due to an existing entry (EEXIST). Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] rhashtable: Remove obsolete rhashtable_walk_init function

2019-02-13 Thread Herbert Xu
ree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Herbert-Xu/rhashtable-Remove-obsolete-rhashtable_walk_init-function/20190213-182336 > config: x86_64-lkp (attached as .config) > compiler: gcc-8 (Debian 8.2.0-20)

[PATCH] rhashtable: Remove obsolete rhashtable_walk_init function

2019-02-12 Thread Herbert Xu
off-by: Herbert Xu diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index 20f9c6af7473..ae9c0f71f311 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h @@ -1113,14 +1113,6 @@ static inline int rhashtable_replace_fast( return err; } -/* Obsol

[PATCH] mac80211: Use rhashtable_lookup_get_insert_fast instead of racy code

2019-02-12 Thread Herbert Xu
On Wed, Feb 13, 2019 at 01:05:51PM +0800, Herbert Xu wrote: > Hi: > > This patch fixes a number of issues with the use of the rhashtable API > in mac80211. First of all it converts the use of rashtable walks over > to a simple linked list. This is because an rhashtable walk

[PATCH 1/2] mac80211: Use linked list instead of rhashtable walk for mesh tables

2019-02-12 Thread Herbert Xu
of the current position, it always converts the current position to an integer which defeats the purpose of the iterator. Therefore this patch converts all uses of rhashtable walk into a simple linked list. Signed-off-by: Herbert Xu --- net/mac80211/mesh.h |4 + net/mac80211/mesh_p

[PATCH 2/2] mac80211: Free mpath object when rhashtable insertion fails

2019-02-12 Thread Herbert Xu
When rhashtable insertion fails the mesh table code doesn't free the now-orphan mesh path object. This patch fixes that. Signed-off-by: Herbert Xu --- net/mac80211/mesh_pathtbl.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/net/mac80211/mesh_pathtb

[PATCH 0/2] mac80211: Fix incorrect usage of rhashtable walk API

2019-02-12 Thread Herbert Xu
27;re trying to lookup an object to delete. It also fixes a potential memory leak when the rhashtable insertion fails (which can occur due to OOM). Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2] rhashtable: make walk safe from softirq context

2019-02-12 Thread Herbert Xu
is approach. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2] rhashtable: make walk safe from softirq context

2019-02-07 Thread Herbert Xu
On Fri, Feb 08, 2019 at 05:48:34AM +0800, Herbert Xu wrote: > > > > Could you please show me who is doing this so I can review that > > > to see whether it's a legitimate use of this API? > > > > I'm sure you'll say it's not legitimate, but

Re: [PATCH v2] rhashtable: make walk safe from softirq context

2019-02-07 Thread Herbert Xu
t; > I'm sure you'll say it's not legitimate, but it still exists ;-) > > mesh_plink_broken() gets called from the TX status path, via > ieee80211s_update_metric(). Let me take a look. Thanks! -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2] rhashtable: make walk safe from softirq context

2019-02-07 Thread Herbert Xu
would still cause it to complain. > > Cc: sta...@vger.kernel.org > Reported-by: Jouni Malinen > Signed-off-by: Johannes Berg This interface wasn't designed for use in softirq contexts. Could you please show me who is doing this so I can review that to see whether it's a le

Re: [PATCH v3] lib/test_rhashtable: Make test_insert_dup() allocate its hash table dynamically

2019-01-31 Thread Herbert Xu
> ? rest_init+0x230/0x230 > ? kernel_init+0x10/0x110 > ? schedule_tail_wrapper+0x9/0xc > ? ret_from_fork+0x19/0x24 > > Cc: Thomas Graf > Cc: Herbert Xu > Cc: netdev@vger.kernel.org > Cc: linux-ker...@vger.kernel.org > Signed-off-by: Bart Van Assche > --- >

[v2 PATCH] rhashtable: Still do rehash when we get EEXIST

2019-01-23 Thread Herbert Xu
t the rehash and then rescheduling so that we can shrink after the completion of the rehash should it still be necessary. The return value of EEXIST captures this case and other cases (e.g., another thread expanded/rehashed the table at the same time) where we should still proceed with the r

Re: [PATCH] crypto:authencesn: Avoid twice completion call in decrypt path

2019-01-10 Thread Herbert Xu
] __do_softirq+0xcb/0x280 > [ 338.730054] irq_exit+0xde/0xf0 > [ 338.733504] do_IRQ+0x54/0xd0 > [ 338.736745] common_interrupt+0xf/0xf > > Signed-off-by: Harsh Jain > Cc: sta...@vger.kernel.org Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: IPSec ESN: Packets decryption fail with ESN enabled connection

2019-01-02 Thread Herbert Xu
t; 1) Is this an expected variable with ESN enables connection?. > > > > 2) If packets are supposed to be dropped can't we avoid decryption overhead. > > > > Following logs are attached > > > > 1) dmesg log > > > > 2) debug patch used to reproduce the

[PATCH] ipv6: frags: Fix bogus skb->sk in reassembled packets

2018-12-20 Thread Herbert Xu
ported-by: Xiumei Mu Fixes: 219badfaade9 ("ipv6: frags: get rid of ip6frag_skb_cb/...") Signed-off-by: Herbert Xu diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 5c3c92713096..a98f95fb6eac 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -378,6 +

Re: [PATCH] [v2] test_rhashtable: remove semaphore usage

2018-12-17 Thread Herbert Xu
it kthread_create()+wake_up_process() > and completely eliminate the separate synchronization. > > Acked-by: Phil Sutter > Signed-off-by: Arnd Bergmann Acked-by: Herbert Xu -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: INFO: rcu detected stall in xfrm_hash_rebuild

2018-12-14 Thread Herbert Xu
ombo and then move onto the new one. Of course I never had time to finish this and I think the entity asking for this has moved onto something else. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] crypto: user - support incremental algorithm dumps

2018-12-13 Thread Herbert Xu
t; --- > crypto/crypto_user_base.c | 37 - > 1 file changed, 20 insertions(+), 17 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next] rhashtable: further improve stability of rhashtable_walk

2018-12-13 Thread Herbert Xu
t count, but I don't think that > hurts. > > Finally, there is more pointer chasing as the chains are longer. The biggest problem is that you can no longer return the lookup result. When you perform a lookup on rhltable you need to return all the matching objects, not just a random one. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next] rhashtable: further improve stability of rhashtable_walk

2018-12-12 Thread Herbert Xu
On Wed, Dec 12, 2018 at 07:49:08PM +1100, NeilBrown wrote: > On Wed, Dec 12 2018, Herbert Xu wrote: > > > On Wed, Dec 12, 2018 at 05:41:29PM +1100, NeilBrown wrote: > >> > >> So you would substantially slow down the rhashtable_walk_start() step. > > > >

Re: [PATCH net-next] rhashtable: further improve stability of rhashtable_walk

2018-12-12 Thread Herbert Xu
ed was an issue then surely you would not drop out of the RCU read lock at all while iterating. It sounds to me like you're trying to use this interface for something that it's simply not designed to do. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herber

Re: [PATCH net-next] rhashtable: further improve stability of rhashtable_walk

2018-12-11 Thread Herbert Xu
ects into the actual hash table. That would solve the issue for both rhashtable and rhlist. Could we do that rather than using this ordered list that only works for rhashtable? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] test_rhashtable: remove semaphore usage

2018-12-10 Thread Herbert Xu
if (wait_event_interruptible(startup_wait, atomic_read(&startup_count) > == 0)) > + pr_err(" wait_event interruptible failed\n"); > + /* count is 0 now, set it to -1 and wake up all threads together */ > + atomic_dec(&startup_count); > + wake_up_all(&startup_wait); > for (i = 0; i < tcount; i++) { > if (IS_ERR(tdata[i].task)) > continue; > -- > 2.20.0 > -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next] rhashtable: further improve stability of rhashtable_walk

2018-12-10 Thread Herbert Xu
ash) then that would be a bug that we should fix. Anything else like duplicates just needs to be accepted by the caller. So please explain how can an object be missed then we can work on fixing that and that only. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/

Re: [PATCH net-next] rhashtable: further improve stability of rhashtable_walk

2018-12-06 Thread Herbert Xu
I couldn't > applied then because it assumed another rhashtable patch which hadn't > landed yet - it now has. I thought we had agreed to drop this because nobody needs it currently and it doesn't handle rhlist? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v3] rhashtable: detect when object movement between tables might have invalidated a lookup

2018-12-02 Thread Herbert Xu
On Mon, Dec 03, 2018 at 09:20:23AM +1100, NeilBrown wrote: > > I don't understand how this is relevant. Thanks for the explanation, I had missed the double pointer part. With that, I'm happy with this patch as it stands: Acked-by: Herbert Xu Cheers, -- Email: Herbert Xu

Re: [PATCH v3] rhashtable: detect when object movement between tables might have invalidated a lookup

2018-12-01 Thread Herbert Xu
ou missed my earlier reply beause of bouncing emails. I think this is unnecessary because RHT_NULLS_MARKER(RHT_NULLS_MARKER(0)) = RHT_NULLS_MARKER(0) Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-20 Thread Herbert Xu
ding bytes (NET_SKB_PAD) if needed. Yes I agree. It doesn't hurt to dump more data. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-19 Thread Herbert Xu
x checksum fault if the checksum turns out to be correct in that case but it's not really a big deal. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] rhashtable: detect when object movement between tables might have invalidated a lookup

2018-11-18 Thread Herbert Xu
On Mon, Nov 19, 2018 at 11:56:35AM +0800, Herbert Xu wrote: > > I take that back. Because of your shift which cancels out the > shift in NULLS_MARKER, it would appear that this should work just > fine with RHT_NULLS_MARRKER(0), no? IOW, it would appear that > >

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-18 Thread Herbert Xu
validation of the original skb->csum. > So this check should be still inverted there?? > > Or am I still missing anything here? What do you mean? My copy of nf_ip_checksum seems to be doing the right thing as far as verifying CHECKSUM_COMPLETED goes. Cheers, -- Emai

Re: [PATCH] rhashtable: detect when object movement between tables might have invalidated a lookup

2018-11-18 Thread Herbert Xu
On Mon, Nov 19, 2018 at 11:54:15AM +0800, Herbert Xu wrote: > > > >> diff --git a/lib/rhashtable.c b/lib/rhashtable.c > > >> index 30526afa8343..852ffa5160f1 100644 > > >> --- a/lib/rhashtable.c > > >> +++ b/lib/rhashtable.c > > >> @@

Re: [PATCH] rhashtable: detect when object movement between tables might have invalidated a lookup

2018-11-18 Thread Herbert Xu
rhash_head __rcu *rhnull; > > > > I don't understand why you can't continue to do NULLS_MARKER(0) or > > RHT_NULLS_MARKER(0). > > Because then the test > > + } while (he != RHT_NULLS_MARKER(head)); > > in __rhashtable_lookup() would always succeed, and i

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-15 Thread Herbert Xu
te packet plus the hardware-generated checksum. That would make debugging these rare hardware faults much easier. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-15 Thread Herbert Xu
marc.info/?l=linux-netdev&m=154086647601721&w=2 Can you please provide your backtrace? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-15 Thread Herbert Xu
no warning or InCsumErrors after 1 hour. > > Fixes: fb286bb2990a ("[NET]: Detect hardware rx checksum faults correctly") > Cc: Herbert Xu > Cc: Tom Herbert > Cc: Eric Dumazet > Signed-off-by: Cong Wang > --- > net/core/datagram.c | 4 ++-- > net/core/dev

Re: [PATCH] net-xfrm: add build time cfg option to PF_KEY SHA256 to use RFC4868-compliant truncation

2018-10-16 Thread Herbert Xu
be decided at run-time. In fact you can already do this at run-time anyway through the xfrm interface. So please please please just ditch whatever that you're using that's still glued to the long-obsolete (more than a decade) af_key interface and switch it over to xfrm. Thanks, -- E

Re: [PATCH net] inet: frags: rework rhashtable dismantle

2018-10-01 Thread Herbert Xu
ble_walk_start(&hti); > + } > + } The walk interface was designed to handle read-only iteration through the hash table. While this probably works since the actual freeing is delayed by RCU, it seems to be rather fragile. How about using the dead flag but inst

Re: [PATCH net] rhashtable: prevent work queue schedule while dismantling

2018-10-01 Thread Herbert Xu
you're still invoking the normal rhashtable remove function. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH - revised] rhashtable: detect when object movement might have invalidated a lookup

2018-07-15 Thread Herbert Xu
htable to another. I'm relucant to add semantics that would restrain on how rhashtable works unless we have real and valid use-cases for it. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2] rhashtable: add restart routine in rhashtable_free_and_destroy()

2018-07-08 Thread Herbert Xu
k_net_init+0x130/0x130 [nfnetlink] > [ 200.975525] ? debug_show_all_locks+0x290/0x290 > [ 200.980363] ? debug_show_all_locks+0x290/0x290 > [ 200.986356] ? sched_clock_cpu+0x132/0x170 > [ 200.990352] ? find_held_lock+0x39/0x1b0 > [ 200.994355] ? sched_clock_local+0x10d/0x130 > [ 200.999531] ? memset+0x1f/0x40 > > V2: > - free all tables requested by Herbert Xu > > Signed-off-by: Taehee Yoo Acked-by: Herbert Xu Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] rhashtable: add restart routine in rhashtable_free_and_destroy()

2018-07-03 Thread Herbert Xu
ture_tbl, ht); > + if (tbl) > + goto restart; > } > - > - bucket_table_free(tbl); > + bucket_table_free(rht_dereference(ht->tbl, ht)); Good catch. But don't we need to call bucket_table_free on all the tables too rather than just the firs

Re: [PATCH] crypto: chtls: generic handling of data and hdr

2018-05-26 Thread Herbert Xu
> Signed-off-by: Atul Gupta > Signed-off-by: Harsh Jain Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] lib/rhashtable: reorder some inititalization sequences

2018-05-14 Thread Herbert Xu
t; Also move the locking initialization down to the end. > > > > Signed-off-by: Davidlohr Bueso > > The user potentially "doing something bogus" is why the most > expensive part of the initialization (the memory allocation) > is done after everything else is vali

Re: [PATCH 6/8] rhashtable: further improve stability of rhashtable_walk

2018-05-07 Thread Herbert Xu
Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-07 Thread Herbert Xu
; table. This must not be allowed to occur. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 2/8] rhashtable: remove nulls_base and related code.

2018-05-07 Thread Herbert Xu
t the network stack. As the aim is to convert as many existing hash tables to rhashtable as possible, we want to keep this. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-05 Thread Herbert Xu
r may not have even started from the same place. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 4/8] rhashtable: fix race in nested_table_alloc()

2018-05-05 Thread Herbert Xu
instantiate the same nested table. I think you missed the fact that when we use nested tables the spin lock table is limited to just a single page and hence corresponds to the first level in the nested table. Therefore it's always safe. Cheers, -- Email: Herbert Xu Home Page: http://gondor.a

Re: [PATCH 7/8] rhashtable: add rhashtable_walk_prev()

2018-05-05 Thread Herbert Xu
s is the same as was returned by the last ->next() call, > then rhashtable_walk_prev() can be used to re-establish the > current location in the table. If it returns NULL, then > rhashtable_walk_next() should be used. > > Signed-off-by: NeilBrown I will ack this if Tom is OK with

Re: [PATCH 6/8] rhashtable: further improve stability of rhashtable_walk

2018-05-05 Thread Herbert Xu
ULL and not >safe, it walks the chain looking for the first object with an >address greater than p and returns that. If there is none, it moves >to the next hash chain. > > Signed-off-by: NeilBrown I'm a bit torn on this. On the hand this is definitely an improve

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-05 Thread Herbert Xu
multiple tables in existence. Unless you hold the lock on the first table, what is to stop two parallel inserters each from inserting into their "last" tables which may not be the same table? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 5/8] rhashtable: remove rhashtable_walk_peek()

2018-05-05 Thread Herbert Xu
r, sometimes it doesn't. > > This function is not currently used and is not worth keeping, so > remove it. > > Signed-off-by: NeilBrown I don't have a problem with this. But it would be good to hear from Tom Herbert who added this. -- Email: Herbert Xu Home Page: http

Re: [PATCH 4/8] rhashtable: fix race in nested_table_alloc()

2018-05-05 Thread Herbert Xu
meant to be held around this operation? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 3/8] rhashtable: use cmpxchg() to protect ->future_tbl.

2018-05-05 Thread Herbert Xu
own This looks nice. > - spin_unlock_bh(old_tbl->locks); > + rcu_assign_pointer(tmp, new_tbl); Do we need this barrier since cmpxchg is supposed to provide memory barrier semantics? > + if (cmpxchg(&old_tbl->future_tbl, NULL, tmp) != NULL) > + return -EEXIST; Tha

Re: [PATCH 2/8] rhashtable: remove nulls_base and related code.

2018-05-05 Thread Herbert Xu
ll be a use for this. As to the bug fix, please separate it out of the patch and resubmit. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 1/8] rhashtable: silence RCU warning in rhashtable_test.

2018-05-05 Thread Herbert Xu
t think the mutex is actually needed but since we don't have rht_dereference_raw and this is just test code: Acked-by: Herbert Xu -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] net/xfrm: Fix lookups for states with spi == 0

2018-05-02 Thread Herbert Xu
ould not be added to the SPI hash because we do not care about it on deleting path. Signed-off-by: Masahide NAKAMURA Signed-off-by: YOSHIFUJI Hideaki I think it would be better to revert this. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbe

Re: [PATCH] net/xfrm: Fix lookups for states with spi == 0

2018-05-02 Thread Herbert Xu
't possible to workaround from userspace as > xfrm_id_proto_match() will be always true for ah/esp/comp protos. > > So, don't try looking up by hash if SPI == 0. > > Cc: Steffen Klassert > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: netdev@vger.kern

Re: [PATCH 6/6] rhashtable: add rhashtable_walk_prev()

2018-04-23 Thread Herbert Xu
ses > it can be useful for the client to know whether it got the previous one > or not. I see. I'm OK with this provided that you will also remove/convert users of rhashtable_walk_peek. I don't think we need two functions that do almost the same thing. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-23 Thread Herbert Xu
> > Neither rhashtable_walk_enter() or rhltable_walk_enter() sleep, though > they do take a spinlock without irq protection. > So revise the comments to accurately state the contexts in which > these functions can be called. > > Signed-off-by: NeilBrown Acked-by: Herbert X

Re: [PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-18 Thread Herbert Xu
? Previously the not able to sleep part completely ruled out any ambiguity but the new wording could confuse people into thinking that this can be called from softirq context where it would be unsafe if mixed with process context usage. Thanks, -- Email: Herbert Xu Home Page: http://gond

Re: [PATCH 6/6] rhashtable: add rhashtable_walk_prev()

2018-04-18 Thread Herbert Xu
for this function and its difference from the existing rhashtable_walk_peek? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 1/6] rhashtable: remove outdated comments about grow_decision etc

2018-04-18 Thread Herbert Xu
On Wed, Apr 18, 2018 at 04:47:01PM +1000, NeilBrown wrote: > grow_decision and shink_decision no longer exist, so remove > the remaining references to them. > > Signed-off-by: NeilBrown Acked-by: Herbert Xu -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ P

Re: [PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-18 Thread Herbert Xu
does a naked spin lock so even though we removed the memory allocation you still mustn't call it from interrupt context. Why do you need to do that anyway? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-04-05 Thread Herbert Xu
ity so our sample space is not too small. Automatic shrinking shouldn't be an issue because that's the slow kind of resizing that we punt to kthread context and it can afford to do a careful count. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [Cluster-devel] [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek

2018-04-04 Thread Herbert Xu
to rush things. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek

2018-04-02 Thread Herbert Xu
e to > use iter.p directly. Yes that would definitely be the preferred option. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v3 net-next 07/12] rhashtable: add schedule points

2018-03-30 Thread Herbert Xu
y: Eric Dumazet Acked-by: Herbert Xu Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 net-next 07/12] rhashtable: add schedule points

2018-03-30 Thread Herbert Xu
y: Eric Dumazet Acked-by: Herbert Xu Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next 4/6] inet: frags: use rhashtables for reassembly units

2018-03-30 Thread Herbert Xu
nctions too: - nested_table_free - bucket_table_alloc - rhashtable_rehash_table Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next 4/6] inet: frags: use rhashtables for reassembly units

2018-03-30 Thread Herbert Xu
f->match(q, key)) { > - refcount_inc(&q->refcnt); > - spin_unlock(&hb->chain_lock); > - return q; > - } > - depth++; > - } > - spin_unlock(&hb->chain_lock); > + struct inet_frag_queue *fq; > > - if (depth <= INETFRAGS_MAXDEPTH) > - return inet_frag_create(nf, f, key); > + rcu_read_lock(); > > - if (inet_frag_may_rebuild(f)) { > - if (!f->rebuild) > - f->rebuild = true; > - inet_frag_schedule_worker(f); > + fq = rhashtable_lookup(&nf->rhashtable, key, nf->f->rhash_params); Ditto. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek

2018-03-29 Thread Herbert Xu
peek. As otherwise the object that triggers the out-of-space condition will be skipped upon resumption. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek

2018-03-29 Thread Herbert Xu
le in the face of removals. https://patchwork.ozlabs.org/patch/892534/ Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek

2018-03-29 Thread Herbert Xu
ference, we must defer that to a work queue because dropping the last > reference may sleep. In light of Neil's latest patch, do we still need this? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 2/2] rhashtable: improve rhashtable_walk stability when stop/start used.

2018-03-28 Thread Herbert Xu
will need to proceed > through the whole table again to be sure to see everything at least > once. > > Signed-off-by: NeilBrown Very nice! Acked-by: Herbert Xu -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

<    1   2   3   4   5   6   7   8   9   10   >