Re: [PATCH net] xfrm: Fix xfrm sel prefix length validation

2019-05-21 Thread Herbert Xu
e address prefix lengths in the xfrm > selector.") > Signed-off-by: Anirudh Gupta 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-next 11/11] inet: frags: rework rhashtable dismantle

2019-05-27 Thread Herbert Xu
? If it's meant to separate the setting of dead and the subsequent destruction work then it doesn't work because the barrier only protects the code preceding it, not after. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[PATCH] rhashtable: Add rht_ptr_rcu and improve rht_ptr

2019-05-28 Thread Herbert Xu
This patch moves common code between rht_ptr and rht_ptr_exclusive into __rht_ptr. It also adds a new helper rht_ptr_rcu exclusively for the RCU case. This way rht_ptr becomes a lock-only construct so we can use the lighter rcu_dereference_protected primitive. Signed-off-by: Herbert Xu

[PATCH] inet: frags: Remove unnecessary smp_store_release/READ_ONCE

2019-05-28 Thread Herbert Xu
in order to not confuse future readers of this code. Comments have been added in their places. Signed-off-by: Herbert Xu diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 2b816f1ebbb4..35e9784fab4e 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c @@ -193,1

Re: [PATCH] inet: frags: Remove unnecessary smp_store_release/READ_ONCE

2019-05-28 Thread Herbert Xu
in_lock shared_var = 1 spin_lock spin_unlock if (shared_var == 1) ... spin_unlock Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] inet: frags: Remove unnecessary smp_store_release/READ_ONCE

2019-05-31 Thread Herbert Xu
hy you need them and why the code would be buggy if you don't use them. In this case the code doesn't need them because an implicit barrier() (which is *stronger* than READ_ONCE/WRITE_ONCE) already exists in both places. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org

Re: [PATCH] crypto: Rename struct device_private to bcm_device_private

2021-01-13 Thread Herbert Xu
2qgg@e107158-lin/ > Signed-off-by: Jiri Olsa > --- > drivers/crypto/bcm/cipher.c | 2 +- > drivers/crypto/bcm/cipher.h | 4 ++-- > drivers/crypto/bcm/util.c | 2 +- > 3 files changed, 4 insertions(+), 4 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: [RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-12-01 Thread Herbert Xu
hat we can pass in an offset into the output sg as well? Couldn't you just change the output sg to include the offset? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-12-01 Thread Herbert Xu
PI the underlying implementataions would just have to do the same thing. Since this is particular to your use-case it's better to leave the complexity where it's needed rather than propagting it to all the crypto drivers. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org

Re: Why the auxiliary cipher in gss_krb5_crypto.c?

2020-12-04 Thread Herbert Xu
on the side of the caller. Maybe there is a way to reuse that here. > Herbert? Yes this was one of the reasons I was persuing the continuation work. It should allow us to kill the special case for CTS in the krb5 code. Hopefully I can get some time to restart work on this soon. Cheers, --

Re: [PATCH net] netdevice.h: Fix unintentional disable of ALL_FOR_ALL features on upper device

2020-11-24 Thread Herbert Xu
27;re trying to enable a feature on the virtual device unconditionally. > We might ask Herbert Xu if we : > > 1) Need to comment the function, or change its name to be more descriptive. > 2) Change the behavior (as you suggested) > 3) Other choice. I think Tariq's patch is fine, al

Re: [RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-11-25 Thread Herbert Xu
are actually sharing this code with sunrpc, am I missing something? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [RFC][PATCH 00/18] crypto: Add generic Kerberos library

2020-11-26 Thread Herbert Xu
> be required to wrap it up in the autoloading, module-handling mechanisms. I don't have any problems with it living under crypto. However, I'd like to see what the sunrpc code looks like before going one way or another. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.o

Re: [PATCH v9,net-next,12/12] crypto: octeontx2: register with linux crypto framework

2020-11-12 Thread Herbert Xu
512),ecb(cipher_null)), > > rfc4106(gcm(aes)). > > Herbert, could someone who knows about crypto take a look at this, > if the intention is to merge this via net-next? This patch seems to be quite large but it is self-contained. How about waiting a release cycle and then resubmit

Re: [PATCH v9,net-next,12/12] crypto: octeontx2: register with linux crypto framework

2020-11-15 Thread Herbert Xu
On Fri, Nov 13, 2020 at 08:44:40AM -0800, Jakub Kicinski wrote: > > SGTM, actually everything starting from patch 4 is in drivers/crypto, > so we can merge the first 3 into net-next and the rest via crypto? Yes of course. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apa

Re: gssapi, crypto and afs/rxrpc

2020-10-18 Thread Herbert Xu
27;d make sense. Otherwise a library helper would be more appropriate. 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: xfrm: fix a race condition during allocing spi

2020-10-21 Thread Herbert Xu
es*/ > hlist_add_head_rcu(&x->byspi) > > So the same xfrm_stame (x) is added into the same list_hash > (net->xfrm.state_byspi)2 times that makes the list_hash become > a inifite loop. Your explanation makes no sense. Prior to obtaining the spin lock on the LHS,

Re: [PATCH] net: xfrm: fix a race condition during allocing spi

2020-10-21 Thread Herbert Xu
this was introduced with the dynamic resizing in f034b5d4efdfe0fb9e2a1ce1d95fa7914f24de49. 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: xfrm: fix a race condition during allocing spi

2020-10-22 Thread Herbert Xu
ifite loop. > > To fix the race, x->id.spi = htonl(spi) in the xfrm_alloc_spi() is moved > to the back of spin_lock_bh, sothat state_hash_work thread no longer add x > which id.spi is zero into the hash_list. > > Fixes: f034b5d4efdf ("[XFRM]: Dynamic xfrm_state hash table

Re: [PATCH] xfrm/compat: Remove use of kmalloc_track_caller

2020-11-01 Thread Herbert Xu
[net/xfrm/xfrm_compat.ko] undefined! Is this with a recent kernel? Because they should be exported: commit fd7cb5753ef49964ea9db5121c3fc9a4ec21ed8e Author: Daniel Vetter Date: Mon Mar 23 15:49:00 2020 +0100 mm/sl[uo]b: export __kmalloc_track(_node)_caller Cheers, -- Email: He

Re: [PATCH ipsec] xfrm: Pass template address family to xfrm_state_look_at

2020-11-03 Thread Herbert Xu
do the comparison on flow you must use the original family and not some other value. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH ipsec] xfrm: Pass template address family to xfrm_state_look_at

2020-11-03 Thread Herbert Xu
6-over-v4 in transport mode? Isn't that the whole point of BEET mode? 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] macvlan: macvlan_count_rx() needs to be aware of preemption

2021-03-10 Thread Herbert Xu
a4 > kernel/kthread.c:292) > r10:85247e64 r9:898dac80 r8:80269d68 r7: r6:8a9c6000 r5:89a2ee40 > r4:8a97bd00 > [<80271dbc>] (kthread) from [<80200114>] (ret_from_fork+0x14/0x20 > arch/arm/kernel/entry-common.S:158) > Exception stack(0x8a9c7fb0 to 0x8a9c7ff8) &

Re: [PATCH net-next 2/2] net: socket: change MSG_CMSG_COMPAT to BIT(21)

2021-03-21 Thread Herbert Xu
> fixups */ > -#else > -#define MSG_CMSG_COMPAT 0 /* We never have 32 bit fixups > */ > -#endif Shouldn't you add some comment here to stop people from trying to use BIT(31) in the future? 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 2/3] drivers: crypto: add support for OCTEONTX2 CPT engine

2020-08-12 Thread Herbert Xu
line = lf->lmtline; > + long ret; > + > + /* > + * Make sure memory areas pointed in CPT_INST_S > + * are flushed before the instruction is sent to CPT > + */ > + smp_wmb(); Why should this be a NOOP on UP? Cheers, -- Email: Herbert Xu H

Re: [PATCH v2 2/3] drivers: crypto: add support for OCTEONTX2 CPT engine

2020-08-12 Thread Herbert Xu
lease work out a way with the ARM folks to fix this without adding assembly code in a driver. 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 3/3] drivers: crypto: add the Virtual Function driver for OcteonTX2 CPT

2020-08-12 Thread Herbert Xu
opping new users from coming in after you've finished the test. 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: hifn_795x - switch from 'pci_' to 'dma_' API

2020-08-21 Thread Herbert Xu
_set_dma_mask(e1, e2) > +dma_set_mask(&e1->dev, e2) > > @@ > expression e1, e2; > @@ > -pci_set_consistent_dma_mask(e1, e2) > +dma_set_coherent_mask(&e1->dev, e2) > > Signed-off-by: Christophe JAILLET > --- > If needed, see post from Christoph Hellwig on the kernel-janitors ML: >https://marc.info/?l=kernel-janitors&m=158745678307186&w=4 > --- > drivers/crypto/hifn_795x.c | 21 - > 1 file changed, 12 insertions(+), 9 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

[PATCH] net: Get rid of consume_skb when tracing is off

2020-08-21 Thread Herbert Xu
The function consume_skb is only meaningful when tracing is enabled. This patch makes it conditional on CONFIG_TRACEPOINTS. Signed-off-by: Herbert Xu diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 46881d902124..e8bca74857a3 100644 --- a/include/linux/skbuff.h +++ b/include

Re: [PATCH] net: Get rid of consume_skb when tracing is off

2020-08-21 Thread Herbert Xu
gt; We want the following to be supported. > > perf probe consume_skb That should continue to work as this patch does not change anything when CONFIG_TRACEPOINTS is enabled. 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: Get rid of consume_skb when tracing is off

2020-08-22 Thread Herbert Xu
On Sat, Aug 22, 2020 at 01:54:19PM -0400, Neil Horman wrote: > > Wouldn't it be better to make this: > #define consume_skb(x) kfree_skb(x) Either way is fine but I prefer inline functions over macros. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/

Re: [PATCH v2 7/7] crypto: arc4 - mark ecb(arc4) skcipher as obsolete

2020-08-24 Thread Herbert Xu
lg. CRYPTO_USER is the configuration interface which has nothing to do with af_alg. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH ipsec] xfrm: fix sa selector validation

2019-06-14 Thread Herbert Xu
CC: Anirudh Gupta > Signed-off-by: Nicolas Dichtel Acked-by: Herbert Xu Sorry for not catching 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 v2] net: ipv4: move tcp_fastopen server side code to SipHash library

2019-06-16 Thread Herbert Xu
78 deletions(-) You should also revert commit 798b2cbf9227 in your patch: commit 798b2cbf9227b1bd7d37ae9af4d9c750e6f4de9c Author: David S. Miller Date: Tue Sep 4 14:20:14 2012 -0400 net: Add INET dependency on aes crypto for the sake of TCP fastopen. 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 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] 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 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 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 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 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 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 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 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 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 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 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 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-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 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 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 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 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 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 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 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 1/6] rhashtable: improve documentation for rhashtable_walk_peek()

2018-03-27 Thread Herbert Xu
art() > + * or when the iterator is reset. In this case there > + * is no previous object to return. > + */ > + return NULL; > > return __rhashtable_walk_find_next(iter); > } > > -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 3/6] rhashtable: reset intr when rhashtable_walk_start sees new table

2018-03-27 Thread Herbert Xu
for it to be true. > > Signed-off-by: NeilBrown 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 4/6] rhashtable: allow a walk of the hash table without missing objects.

2018-03-27 Thread Herbert Xu
htable *ht = iter->ht; > > rcu_read_lock(); > > + if (!obj || iter->p != obj) > + iter->p = NULL; Why bother with this check at all? Couldn't we make it so that if you call continue then you continue with the cursor otherwise you set it to NULL as we

Re: [PATCH 4/6] rhashtable: allow a walk of the hash table without missing objects.

2018-03-27 Thread Herbert Xu
ost objects due to concurrent removals. 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-03-27 Thread Herbert Xu
The current code should never fail an insertion until you actually run ouf memory. That is unless you're using rhashtable when you should be using rhlist instead. 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-03-27 Thread Herbert Xu
completely. Would that be acceptable to your use-case? 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/6] rhashtable: allow a walk of the hash table without missing objects.

2018-03-27 Thread Herbert Xu
k it with a flag like rht_marker so that normal traversal doesn't see it. That way the removal code can simply traverse that list and inform them that the iterator is invalid. 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-03-28 Thread Herbert Xu
???) We could also take the spinlock table approach and have a counter per bucket spinlock. This should be sufficient as you'll contend on the bucket spinlock table anyway. This also allows us to estimate the total table size and not have to always do a last-ditch growth when it's too l

Re: [PATCH 4/6] rhashtable: allow a walk of the hash table without missing objects.

2018-03-28 Thread Herbert Xu
e to differentiate between a walker, a normal object, and the end of the list. I think it should be doable. 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-03-28 Thread Herbert Xu
c_t counter, then we must accept that > the number of elements could exceed any given value. The only promise > we can provide is that it wont exceed N% of the table size for more than > T seconds. Sure. However, assuming we use an estimate that is hash-based, that *should* be fairly acc

Re: [PATCH 1/2] rhashtable: fix insertion of in rhltable when duplicate found.

2018-03-28 Thread Herbert Xu
w > insertion happens at the end of a chain rather than at the head. > I don't think this is an important change. > > Signed-off-by: NeilBrown Thanks. But Paul Blakey beat you to it :) https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=d3dcf8eb61553752

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

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 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
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] tipc: Fix tipc_sk_reinit handling of -EAGAIN

2017-08-24 Thread Herbert Xu
> This patch replaces the continue with a goto and label to ensure a > matching call to rhashtable_walk_stop(). > > Signed-off-by: Bob Peterson Acked-by: Herbert Xu Thanks for catching this! -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

[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: [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

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: 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 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] 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] 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: unify xfrm protocol checks

2019-03-18 Thread Herbert Xu
rproto == IPSEC_PROTO_ANY && xfrm_id_proto_valid(proto))); > } This does not look right. IPSEC_PROTO_ANY should only be allowed in userproto and your patch is going to let it pass when it's in proto. Whether IPPROTO_ROUTING/IPPROTO_DSTOPTS should be allowed in this context is also n

Re: [Patch net] xfrm: unify xfrm protocol checks

2019-03-19 Thread Herbert Xu
em. 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] xfrm: unify xfrm protocol checks

2019-03-21 Thread Herbert Xu
in the first case and allowed in the second case. 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 v2] xfrm: clean up xfrm protocol checks

2019-03-25 Thread Herbert Xu
proto in validate_tmpl()") > Reported-by: syzbot+0bf0519d6e0de1591...@syzkaller.appspotmail.com > Cc: Steffen Klassert > Cc: Herbert Xu > Signed-off-by: Cong Wang > --- > include/net/xfrm.h | 17 + > net/ipv6/xfrm6_tunnel.c | 2 +- > net/key/af_key.c|

[PATCH] ila: Fix rhashtable walker list corruption

2019-03-25 Thread Herbert Xu
xlat...") Signed-off-by: Herbert Xu diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c index 79d2e43c05c5..5fc1f4e0c0cf 100644 --- a/net/ipv6/ila/ila_xlat.c +++ b/net/ipv6/ila/ila_xlat.c @@ -417,6 +417,7 @@ int ila_xlat_nl_cmd_flush(struct sk_buff *skb, struct genl_info *inf

Re: [PATCH net] rhashtable: fix sparse RCU warnings on bit lock in bucket pointer

2019-05-15 Thread Herbert Xu
#x27;m working on a fix to this. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[PATCH 0/2] rhashtable: Fix sparse warnings

2019-05-16 Thread Herbert Xu
This patch series fixes all the sparse warnings. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[PATCH 2/2] rhashtable: Fix cmpxchg RCU warnings

2019-05-16 Thread Herbert Xu
As cmpxchg is a non-RCU mechanism it will cause sparse warnings when we use it for RCU. This patch adds explicit casts to silence those warnings. This should probably be moved to RCU itself in future. Signed-off-by: Herbert Xu --- lib/rhashtable.c |5 +++-- 1 file changed, 3 insertions

[PATCH 1/2] rhashtable: Remove RCU marking from rhash_lock_head

2019-05-16 Thread Herbert Xu
unnecessary RCU checking. Signed-off-by: Herbert Xu --- include/linux/rhashtable.h | 58 - lib/rhashtable.c | 28 ++--- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/include/linux/rhashtable.h b/include

Re: [PATCH 2/2] rhashtable: Fix cmpxchg RCU warnings

2019-05-16 Thread Herbert Xu
rimitive then yes that what it should do. But it isn't relevant to this patch. 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] Fix a sleep-in-atomic bug in shash_setkey_unaligned

2017-10-04 Thread Herbert Xu
the function which generates the secret key in the first place. AFAICS that's only called in GFP_KERNEL context. What am I missing? 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] Fix a sleep-in-atomic bug in shash_setkey_unaligned

2017-10-05 Thread Herbert Xu
d happen at the point when the key is generated. That's sctp_endpoint_init which AFAICS only gets called in GFP_KERNEL context. Or is there a code-path where sctp_endpoint_init is called in softirq context? 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] Fix a sleep-in-atomic bug in shash_setkey_unaligned

2017-10-05 Thread Herbert Xu
On Thu, Oct 05, 2017 at 06:16:20PM +0800, Herbert Xu wrote: > > That was my point. Functions like sctp_pack_cookie shouldn't be > setting the key in the first place. The setkey should happen at > the point when the key is generated. That's sctp_endpoint_init > which A

Re: [PATCH v8 01/20] crypto: change transient busy return code to -EAGAIN

2017-10-06 Thread Herbert Xu
error ever to the user, do the translation here. > + */ > +static inline int crypto_user_err(int err) > +{ > + if (err == -EAGAIN) > + return -EBUSY; > + > + return err; I don't see the need to carry along this baggage. Does anyone in user-spac

Re: [PATCH 02/10] drivers:crypto: return -ENOMEM on allocation failure.

2017-10-06 Thread Herbert Xu
Allen Pais wrote: > Signed-off-by: Allen Pais 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 v8 01/20] crypto: change transient busy return code to -EAGAIN

2017-10-10 Thread Herbert Xu
On Sat, Oct 07, 2017 at 10:51:42AM +0300, Gilad Ben-Yossef wrote: > On Sat, Oct 7, 2017 at 6:05 AM, Herbert Xu > wrote: > > On Tue, Sep 05, 2017 at 03:38:40PM +0300, Gilad Ben-Yossef wrote: > >> > >> diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c >

Re: [PATCH v9 00/20] simplify crypto wait for async op

2017-10-15 Thread Herbert Xu
On Sun, Oct 15, 2017 at 10:19:45AM +0100, Gilad Ben-Yossef wrote: > > Changes from v8: > - Remove the translation of EAGAIN return code to the > previous return code of EBUSY for the user space > interface of algif as no one seems to rely on it as > requested by Herbert

Re: [PATCH v9 00/20] simplify crypto wait for async op

2017-10-17 Thread Herbert Xu
On Tue, Oct 17, 2017 at 02:55:21PM +0300, Gilad Ben-Yossef wrote: > > Would you mind if we used ENOSPC instead of E2BIG? > > "No space left on device" seems more appropriate than > "Argument list too long". It's fine by me. Thanks, -- Email: Herbert X

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 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 - 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

  1   2   3   4   5   6   7   8   9   10   >