[v3 PATCH] netlink: Do not schedule work from sk_destruct

2016-12-05 Thread Herbert Xu
On Mon, Dec 05, 2016 at 03:26:00PM +0800, Herbert Xu wrote: > On Mon, Dec 05, 2016 at 03:19:46PM +0800, Herbert Xu wrote: > > > > Thanks for the patch. It'll obviously work but I wanted avoid that > > because it penalises the common path for the rare case. > > > &

[v2 PATCH] netlink: Do not schedule work from sk_destruct

2016-12-04 Thread Herbert Xu
On Mon, Dec 05, 2016 at 03:19:46PM +0800, Herbert Xu wrote: > > Thanks for the patch. It'll obviously work but I wanted avoid that > because it penalises the common path for the rare case. > > Andrey, please try this patch and let me know if it's any better. > > ---8<--

Re: net: use-after-free in worker_thread

2016-12-04 Thread Herbert Xu
call which is the only place where it's needed while SOCK_RCU_FREE will force every path to do an RCU deferral. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: net: use-after-free in worker_thread

2016-12-04 Thread Herbert Xu
is patch and let me know if it's any better. ---8<--- Subject: netlink: Do not schedule work from sk_destruct It is wrong to schedule a work from sk_destruct using the socket as the memory reserve because the socket will be freed immediately after the return from sk_destruct. Instead we s

Re: [PATCH net 1/2] esp4: Fix integrity verification when ESN are used

2016-11-30 Thread Herbert Xu
f-by: Tobias Brunner <tob...@strongswan.org> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> Thanks for catching this! -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net 2/2] esp6: Fix integrity verification when ESN are used

2016-11-30 Thread Herbert Xu
f-by: Tobias Brunner <tob...@strongswan.org> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> Thanks. -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: Crash due to mutex genl_lock called from RCU context

2016-11-28 Thread Herbert Xu
t to make the cb->done call where necessary. Fixes: 21e4902aea80 ("netlink: Lockless lookup with RCU grace...") Reported-by: Subash Abhinov Kasiviswanathan <subas...@codeaurora.org> Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> diff --git a/net/netlink/af_netlink.

Re: rhashtable: how to use insecure_elasticity of rhashtable_params

2016-11-07 Thread Herbert Xu
ace. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] crypto: ccm - avoid scatterlist for MAC encryption

2016-10-18 Thread Herbert Xu
he very first user of async crypto. mac80211 on the other hand is currently sync-only. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next 5/7] rhashtable: abstract out function to get hash

2016-09-20 Thread Herbert Xu
rous code which will be worse than using jhash unconditionally. If the rhashtable params are made const then you'll already know whether jhash or jhash2 is used. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gond

Re: skb_splice_bits() and large chunks in pipe (was Re: xfs_file_splice_read: possible circular locking dependency detected

2016-09-20 Thread Herbert Xu
st vectors which test the page-crossing case specifically. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 net-next 0/7] net: ILA resolver and generic resolver backend

2016-09-20 Thread Herbert Xu
David Miller <da...@davemloft.net> wrote: > > Can you please repost this series with Herbert Xu properly CC:'d > since he maintains rhashtable and is making changes to it recently > which might conflict with what you are proposing here? There is no need to respost this serie

Re: [PATCH net-next 6/7] net: Generic resolver backend

2016-09-20 Thread Herbert Xu
ooking at your next patch you have exactly one user for this. So who is going to be the next user and do we really need all these fields to be variable? Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next 5/7] rhashtable: abstract out function to get hash

2016-09-20 Thread Herbert Xu
Signed-off-by: Tom Herbert <t...@herbertland.com> I don't get this one. You're just using jhash, right? Why not call jhash directly instead of rht_get_key_hashfn? Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next 3/7] rhashtable: Call library function alloc_bucket_locks

2016-09-20 Thread Herbert Xu
cked-by: Thomas Graf <tg...@suug.ch> > Signed-off-by: Tom Herbert <t...@herbertland.com> On second thought when I do the nested allocation I could simply restore this function. So Acked-by: Herbert Xu <herb...@gondor.apana.org.au> Cheers, -- Email: Herbert Xu

Re: [v3 PATCH 1/2] rhashtable: Add rhlist interface

2016-09-19 Thread Herbert Xu
On Mon, Sep 19, 2016 at 11:16:21PM +0200, Thomas Graf wrote: > > Nice, I like how this simplifies users! Is this suitable for > ILA as well? Does it have duplicate objects and use inelastic_security? If so then yes it should switch over to rhlist. Cheers, -- Email: Herbert

Re: [PATCH RFC 2/6] rhashtable: Call library function alloc_bucket_locks

2016-09-19 Thread Herbert Xu
s for another purpose, what we can do is provide a helper function to return the right lock for a given key/object. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[v3 PATCH 1/2] rhashtable: Add rhlist interface

2016-09-19 Thread Herbert Xu
for rhlist, including the hash table walker. One missing feature is nulls marking because AFAIK the only potential user of it does not need duplicate objects. Should anyone need this it shouldn't be too hard to add. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> --- include

[v3 PATCH 2/2] mac80211: Use rhltable instead of rhashtable

2016-09-19 Thread Herbert Xu
defaults to jhash. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> --- net/mac80211/ieee80211_i.h |2 - net/mac80211/rx.c |7 +- net/mac80211/sta_info.c| 52 ++--- net/mac80211/sta_info.h| 19 ++-

[v3 PATCH 0/2] rhashtable: rhashtable with duplicate objects

2016-09-19 Thread Herbert Xu
and see if it still works. Thanks! -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [v2 PATCH 0/2] rhashtable: rhashtable with duplicate objects

2016-09-19 Thread Herbert Xu
e to run a > single test ("wpas_ctrl_interface_add_many") to get there. Aha I see the problem now. The nelems logic on remove is broken. I'll send out a v3. Thanks! -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [v2 PATCH 0/2] rhashtable: rhashtable with duplicate objects

2016-09-19 Thread Herbert Xu
On Mon, Sep 19, 2016 at 11:27:24AM +0200, Johannes Berg wrote: > > I have a feeling there's a bug with ht->nelems, since the crash is > always in the grow worker, but I haven't quite put my finger on it yet. Can you show me a stack trace? Thanks, -- Email: Herb

Re: [v2 PATCH 0/2] rhashtable: rhashtable with duplicate objects

2016-09-19 Thread Herbert Xu
On Mon, Sep 19, 2016 at 11:15:30AM +0200, Johannes Berg wrote: > On Mon, 2016-09-19 at 16:40 +0800, Herbert Xu wrote: > > > I've tested the rhlist code with test_rhashtable but I haven't > > tested the mac80211 conversion.  So please give it a go and see > > if it still w

[v2 PATCH 1/2] rhashtable: Add rhlist interface

2016-09-19 Thread Herbert Xu
for rhlist, including the hash table walker. One missing feature is nulls marking because AFAIK the only potential user of it does not need duplicate objects. Should anyone need this it shouldn't be too hard to add. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> --- include

[v2 PATCH 0/2] rhashtable: rhashtable with duplicate objects

2016-09-19 Thread Herbert Xu
insecure_elasticity users over to this. I've tested the rhlist code with test_rhashtable but I haven't tested the mac80211 conversion. So please give it a go and see if it still works. Thanks! -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ P

[v2 PATCH 2/2] mac80211: Use rhltable instead of rhashtable

2016-09-19 Thread Herbert Xu
defaults to jhash. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> --- net/mac80211/ieee80211_i.h |2 - net/mac80211/rx.c |7 +- net/mac80211/sta_info.c| 52 ++--- net/mac80211/sta_info.h| 19 ++-

Re: [PATCH 0/2] rhashtable: rhashtable with duplicate objects

2016-09-19 Thread Herbert Xu
you're seeing but I'll do a v2 posting. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[PATCH 2/2] mac80211: Use rhltable instead of rhashtable

2016-09-18 Thread Herbert Xu
defaults to jhash. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> --- net/mac80211/ieee80211_i.h |2 - net/mac80211/rx.c |7 +- net/mac80211/sta_info.c| 52 ++--- net/mac80211/sta_info.h| 19 ++-

[PATCH 1/2] rhashtable: Add rhlist interface

2016-09-18 Thread Herbert Xu
for rhlist, including the hash table walker. One missing feature is nulls marking because AFAIK the only potential user of it does not need duplicate objects. Should anyone need this it shouldn't be too hard to add. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> --- include

[PATCH 0/2] rhashtable: rhashtable with duplicate objects

2016-09-18 Thread Herbert Xu
to use it. If this works out I'll then proceed to convert the other insecure_elasticity users over to this. I've tested the rhlist code with test_rhashtable but I haven't tested the mac80211 conversion. So please give it a go and see if it still works. Thanks! -- Email: Herbert

Re: [PATCH net-next v2] netlink: don't forget to release a rhashtable_iter structure

2016-09-06 Thread Herbert Xu
don't remove a reference on a rhashtable_iter structure to > release it from netlink_diag_dump_done > > Cc: Herbert Xu <herb...@gondor.apana.org.au> > Fixes: ad202074320c ("netlink: Use rhashtable walk interface in diag dump") > Signed-off-by: Andrei Vagin <ava...@open

Re: [PATCH net] rhashtable: fix a memory leak in alloc_bucket_locks()

2016-08-26 Thread Herbert Xu
d-by: CAI Qian <caiq...@redhat.com> > Signed-off-by: Eric Dumazet <eduma...@google.com> > Cc: Florian Westphal <f...@strlen.de> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> Thanks Eric! -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gond

Re: [PATCH -next v2] chcr: Fix non static symbol warning

2016-08-26 Thread Herbert Xu
static? > > Signed-off-by: Wei Yongjun <weiyongj...@huawei.com> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH nf-next,v2 1/2] rhashtable: add rhashtable_lookup_get_insert_key()

2016-08-26 Thread Herbert Xu
rove handling of EEXIST cases via > honoring the NLM_F_EXCL flag and by checking if the data part of the > mapping matches what we have. > > Cc: Herbert Xu <herb...@gondor.apana.org.au> > Cc: Thomas Graf <tg...@suug.ch> > Signed-off-by: Pablo Neira Ayuso <pa...@netfilte

Re: [RFC PATCH] net: ip_finish_output_gso: Attempt gso_size clamping if segments exceed mtu

2016-08-26 Thread Herbert Xu
han downsizing the packets. If it's not DF then we must fragment only within each frag_list skb. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [v2 PATCH 3/3] netlink: Use rhashtable walk interface in diag dump

2016-08-19 Thread Herbert Xu
On Fri, Aug 19, 2016 at 06:32:37PM +0200, Thomas Graf wrote: > On 08/19/16 at 04:21pm, Herbert Xu wrote: > > This patch converts the diag dumping code to use the rhashtable > > walk code instead of going through rhashtable by hand. The lock > > nl_table_lock is now only t

Re: [PATCH 1/3] rhashtable: Remove GFP flag from rhashtable_walk_init

2016-08-19 Thread Herbert Xu
On Fri, Aug 19, 2016 at 06:25:04PM +0200, Thomas Graf wrote: > On 08/18/16 at 04:50pm, Herbert Xu wrote: > > +/* Obsolete function, do not use in new code. */ > > +static inline int rhashtable_walk_init(struct rhashtable *ht, > > + struct

[v2 PATCH 3/3] netlink: Use rhashtable walk interface in diag dump

2016-08-19 Thread Herbert Xu
This patch converts the diag dumping code to use the rhashtable walk code instead of going through rhashtable by hand. The lock nl_table_lock is now only taken while we process the multicast list as it's not needed for the rhashtable walk. Signed-off-by: Herbert Xu <herb...@gondor.apana.org

Re: [PATCH 3/3] netlink: Use rhashtable walk interface in diag dump

2016-08-19 Thread Herbert Xu
On Thu, Aug 18, 2016 at 04:50:58PM +0800, Herbert Xu wrote: > This patch converts the diag dumping code to use the rhashtable > walk code instead of going through rhashtable by hand. The lock > nl_table_lock is now only taken while we process the multicast > list as it'

Re: [PATCHv3 net-next 3/4] chcr: Support for Chelsio's Crypto Hardware

2016-08-19 Thread Herbert Xu
ntioned in testmgr.h. They also have been tested from user > space using libkcapi and Openssl. > > Signed-off-by: Atul Gupta <atul.gu...@chelsio.com> > Signed-off-by: Hariprasad Shenai <haripra...@chelsio.com> Acked-by: Herbert Xu <herb...@gondor.apana.

Re: [PATCHv3 net-next 0/4] crypto/chcr: Add support for Chelsio Crypto Driver

2016-08-19 Thread Herbert Xu
can push it via > net-next if you like. Sure thing, the crypto part looks good to me. Thanks Dave! -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[PATCH 3/3] netlink: Use rhashtable walk interface in diag dump

2016-08-18 Thread Herbert Xu
This patch converts the diag dumping code to use the rhashtable walk code instead of going through rhashtable by hand. The lock nl_table_lock is now only taken while we process the multicast list as it's not needed for the rhashtable walk. Signed-off-by: Herbert Xu <herb...@gondor.apana.org

[PATCH 2/3] MAINTAINERS: Add extra rhashtable maintainer

2016-08-18 Thread Herbert Xu
As I'm working actively on rhashtable it helps if people CCed me when they work on in. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> --- MAINTAINERS |1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 5d813a3..db09498 100644 --- a/MAINTAINERS

[PATCH 1/3] rhashtable: Remove GFP flag from rhashtable_walk_init

2016-08-18 Thread Herbert Xu
_walk_init at all. The walker is always paired with an iterator so we could just stash ourselves there. This patch does that by introducing a new enter function to replace the existing init function. This way we don't have to churn all the existing users again. Signed-off-by: Herber

[PATCH 0/3] rhashtable: Get rid of raw table walkers part 1

2016-08-18 Thread Herbert Xu
table walkers are already buggy in that they don't handle multiple rhashtables during a resize. Dave/Tomas, please keep an eye out for any new patches that try to introduce raw table walkers and nack them. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page

Re: [PATCH] rhashtable: fix shift by 64 when shrinking

2016-08-15 Thread Herbert Xu
argument of 0, so > let's avoid the call and just fall back to ht->p.min_size (which should > never be smaller than HASH_MIN_SIZE). > > Cc: Herbert Xu <herb...@gondor.apana.org.au> > Signed-off-by: Vegard Nossum <vegard.nos...@oracle.com> Acked-by: Herbert Xu <he

Re: Buggy rhashtable walking

2016-08-08 Thread Herbert Xu
efore I'm ready because I need to work through some crypto patches first. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: Buggy rhashtable walking

2016-08-05 Thread Herbert Xu
-- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Buggy rhashtable walking

2016-08-04 Thread Herbert Xu
times? In particular, __ieee80211_rx_handle_packet would appear to process the same packet multiple times if this were to happen. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: Buggy rhashtable walking

2016-08-04 Thread Herbert Xu
On Thu, Aug 04, 2016 at 03:18:46PM +0800, Herbert Xu wrote: > > So the question is can wireless handle seeing an entry multiple > times? In particular, __ieee80211_rx_handle_packet would appear > to process the same packet multiple times if this were to happen. It's worse th

Re: [PATCH ipsec] xfrm: Ignore socket policies when rebuilding hash tables

2016-07-29 Thread Herbert Xu
> are installed. > > Since the rebuild after changing thresholds is scheduled this crash > could even occur if the userland sets thresholds seemingly before > installing any socket policies. > > Fixes: 53c2e285f970 ("xfrm: Do not hash socket policies") > Signed-off-by:

Re: [PATCH] xfrm: use printk instead of WARN for bad policy reporting

2016-07-27 Thread Herbert Xu
eep it in my local tree to keep it from showing up > again during fuzzing. Please just kill the whole else clause. For soft policy expires we simply need to relay a message to the KM and nothing more. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apa

Re: [PATCH] xfrm: use printk instead of WARN for bad policy reporting

2016-07-26 Thread Herbert Xu
ast it looks like we might > want to do some sort of cleaning up), so I won't touch it for now. It certainly shouldn't be a WARN, it probably shouldn't print anything either. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 3/3] crypto: Added Chelsio Menu to the Kconfig file

2016-07-12 Thread Herbert Xu
Yeshaswi, please fix these warnings/errors even though they're compile-only. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 2/3] chcr: Support for Chelsio's Crypto Hardware

2016-07-12 Thread Herbert Xu
G bit set, it must be queued regardless, but you should return -EBUSY in order to throttle the user and then call the completion function with -EINPROGRESS once the queue can accept more requests from the user. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.ap

Re: [PATCH] xfrm: fix crash in XFRM_MSG_GETSA netlink handler

2016-07-05 Thread Herbert Xu
ossum <vegard.nos...@oracle.com> > > I assume Steffen will pick this up. I think Steffen said that he is going to be on vacation for two weeks starting this week. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 net-next] tcp: md5: use kmalloc() backed scratch areas

2016-06-29 Thread Herbert Xu
ed for those hashing less one block of data or less. If you're aware of any other user in the kernel that is using ahash and is hashing a small amount of data in aggregate (not per update) please let me know. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://g

Re: [PATCH v2 net-next] tcp: md5: use kmalloc() backed scratch areas

2016-06-29 Thread Herbert Xu
hashing short buffer is probably *much* faster. Really? Have you measured the speed difference between the ahash and shash interfaces? Are you sure that this would matter when compared against the speed of hashing a single MD5 block? Cheers, -- Email: Herbert Xu <herb...@gondor.apana

Re: [PATCH v2 net-next] tcp: md5: use kmalloc() backed scratch areas

2016-06-29 Thread Herbert Xu
derstand, if you add SGs to shash you get ahash. So why wouldn't you just use ahash? AFAICS tcp md5 already uses ahash in sync mode so there is nothing asynchronous here at all. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP K

Re: [PATCH v2 net-next] tcp: md5: use kmalloc() backed scratch areas

2016-06-28 Thread Herbert Xu
ashing on virtual addresses. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: Doing crypto in small stack buffers (bluetooth vs vmalloc-stack crash, etc)

2016-06-28 Thread Herbert Xu
d soon. So if you are going to write this then please document skcipher instead. > Also not mentioned in the documentation is that some algorithms *do* > have different implementations depending on key size. SHA-2 is the > classic example. What do you mean by that? SHA has no keying at all.

Re: Doing crypto in small stack buffers (bluetooth vs vmalloc-stack crash, etc)

2016-06-28 Thread Herbert Xu
it into correctness? We have actually gained quite a bit of documentation recently. Have you looked at Documentation/DocBook/crypto-API.tmpl? More is always welcome of course. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key:

Re: Doing crypto in small stack buffers (bluetooth vs vmalloc-stack crash, etc)

2016-06-28 Thread Herbert Xu
nversion though so it'll have to go through the crypto tree. BTW, the only cts user in our tree appears to be implementing CTS all over again and is only calling the crypto API cts for the last two blocks. Someone should fix that. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.or

Re: [PATCH v2 net-next] tcp: md5: use kmalloc() backed scratch areas

2016-06-27 Thread Herbert Xu
On Mon, Jun 27, 2016 at 10:58:42AM -0700, Andy Lutomirski wrote: > > I wonder if it's worth switching from ahash to shash, though. It > would probably be simpler and faster. No shash is not appropriate here because it needs to hash skb frags which are SG lists. Cheers, -- Email: H

Re: [PATCH v4 01/16] bluetooth: Switch SMP to crypto_cipher_encrypt_one()

2016-06-24 Thread Herbert Xu
c: Marcel Holtmann <mar...@holtmann.org> > Cc: Gustavo Padovan <gust...@padovan.org> > Cc: Johan Hedberg <johan.hedb...@gmail.com> > Cc: "David S. Miller" <da...@davemloft.net> > Cc: linux-blueto...@vger.kernel.org > Cc: Herbert Xu <herb...@g

Re: esp: Fix ESN generation under UDP encapsulation

2016-06-23 Thread Herbert Xu
On Thu, Jun 23, 2016 at 11:52:45AM -0400, David Miller wrote: > > Does the ipv6 side need the same fix? Last I checked IPv6 didn't do IPsec UDP-encapsulation so we're safe for now. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~

Re: Doing crypto in small stack buffers (bluetooth vs vmalloc-stack crash, etc)

2016-06-23 Thread Herbert Xu
On Thu, Jun 23, 2016 at 11:48:25AM +0800, Herbert Xu wrote: > > No we never had such an API in the kernel. However, I see that > rxkad does some pretty silly things and we should be able to avoid > using the stack in pretty much all cases. Let me try to come up with > s

esp: Fix ESN generation under UDP encapsulation

2016-06-17 Thread Herbert Xu
s patch fixes this by first of all using the right spot, i.e., 4 bytes off the real ESP header, and then saving this information so that after encryption we can restore it properly. Fixes: 7021b2e1cddd ("esp4: Switch to new AEAD interface") Reported-by: Blair Steven <blair.ste...@allie

Re: rhashtable - rhashtable_insert_fast failed

2016-06-07 Thread Herbert Xu
On Tue, Jun 07, 2016 at 04:47:28PM +0200, Helge Deller wrote: > On 07.06.2016 16:16, Herbert Xu wrote: > > On Tue, Jun 07, 2016 at 04:13:50PM +0200, Helge Deller wrote: > >> > >> What warnings do you mean specifically? Some specific CONFIG_ option ? > > > >

Re: rhashtable - rhashtable_insert_fast failed

2016-06-07 Thread Herbert Xu
On Tue, Jun 07, 2016 at 04:13:50PM +0200, Helge Deller wrote: > > What warnings do you mean specifically? Some specific CONFIG_ option ? Look for GFP_NOWARN in lib/rhashtable.c and delete it. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.

Re: rhashtable - rhashtable_insert_fast failed

2016-06-05 Thread Herbert Xu
the problem here. Enabling warnings at the kmalloc call should be an easy way to check. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [v2 PATCH 1/2] macvlan: Fix potential use-after free for broadcasts

2016-05-31 Thread Herbert Xu
>lowerdev which is confusingly the actual hardware device? Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[v2 PATCH 2/2] macvlan: Avoid unnecessary multicast cloning

2016-05-31 Thread Herbert Xu
all broadcast addresses for a macvlan as we do for multicast and unicast. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index a71fa59..0c65bd9 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -49,6 +49,7

[v2 PATCH 1/2] macvlan: Fix potential use-after free for broadcasts

2016-05-31 Thread Herbert Xu
ate the new skb as you should not modify shared skbs. Fixes: 412ca1550cbe ("macvlan: Move broadcasts into a work queue") Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 2bcf1f3..78a00e3 100644 --- a/drivers/

[v2 PATCH 0/2] macvlan: Avoid unnecessary multicast cloning

2016-05-31 Thread Herbert Xu
promiscuous/allmulti settings weren't handled correctly. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 0/2] macvlan: Avoid unnecessary multicast cloning

2016-05-30 Thread Herbert Xu
On Mon, May 30, 2016 at 07:27:59PM +0300, Lennert Buytenhek wrote: > > That and stack switches to kworker threads and serialisation on > the bc_queue queue lock. My patch should resolve these problems too since the packet is discarded if nobody is interested in it. Cheers, -- Email: H

[PATCH 2/2] macvlan: Avoid unnecessary multicast cloning

2016-05-30 Thread Herbert Xu
for a macvlan as we do for multicast and unicast. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index f55fe21..9fa4532 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -49,6 +49,7 @@ struct macvlan_port {

[PATCH 1/2] macvlan: Fix potential use-after free for broadcasts

2016-05-30 Thread Herbert Xu
ate the new skb as you should not modify shared skbs. Fixes: 412ca1550cbe ("macvlan: Move broadcasts into a work queue") Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 2bcf1f3..78a00e3 100644 --- a/drivers/

[PATCH 0/2] macvlan: Avoid unnecessary multicast cloning

2016-05-30 Thread Herbert Xu
ixes a potential use-after-free bug that I discovered while looking over this. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: BUG: net/netlink: KASAN: use-after-free in netlink_sock_destruct

2016-05-27 Thread Herbert Xu
o idea how > could this happen. netlink_sock_destruct is one of the two exit paths for cb->skb so this is consistent with the previous trace. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: BUG: use-after-free in netlink_dump

2016-05-16 Thread Herbert Xu
e right memory. Fixes: 16b304f3404f ("netlink: Eliminate kmalloc in netlink dump operation.") Reported-by: Baozeng Ding <splovi...@gmail.com> Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 215fc0

Re: [PATCH] macsec: fix crypto Kconfig dependency

2016-04-18 Thread Herbert Xu
kind of silly really now that IPv4 selects CRYPTO which means that you can't really avoid seeing all those options which most users won't care about. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] macsec: fix crypto Kconfig dependency

2016-04-18 Thread Herbert Xu
ver") Thnis patch is bogus. The build error is coming from the fact that GCM is built-in but CRYPTO_ALGAPI is (presumably) only built as a module. The patch in question does nothing to address that AFAICS. In fact this strikes me as a kbuild bug because CRYPTO_GCM already selects (indirectly) CRYPTO_ALGAPI so why is this happening at all? Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] netlink: don't send NETLINK_URELEASE for unbound sockets

2016-04-16 Thread Herbert Xu
ease(struct socket *sock) > >skb_queue_purge(>sk_write_queue); > > - if (nlk->portid) { > + if (nlk->portid && nlk->bound) { Any reason why we're still testing portid at all? Isn't testing bound enough? Thanks, -- Email: Herbert Xu <herb

Re: [PATCH 0/3] crypto: af_alg - add TLS type encryption

2016-04-07 Thread Herbert Xu
suggestions to implement TLS data-path within the kernel. So we should decide whether we pursue that or go with your approach before we start adding algorithms. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apa

Re: [net PATCH v2 2/2] ipv4/GRO: Make GRO conform to RFC 6864

2016-04-04 Thread Herbert Xu
hould not be able to detect its presence from the outside. If you lose information then you're breaking this rule and people will soon start asking for it to be disabled in various situations. I'm not against doing this per se but it should not be part of the default configuration. Cheers, -- Email:

Re: [net PATCH v2 2/2] ipv4/GRO: Make GRO conform to RFC 6864

2016-04-04 Thread Herbert Xu
fixed IDs vs. incrementing IDs. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [net PATCH 2/2] ipv4/GRO: Make GRO conform to RFC 6864

2016-04-01 Thread Herbert Xu
On Fri, Apr 01, 2016 at 07:15:33PM -0700, Eric Dumazet wrote: > On Sat, 2016-04-02 at 09:57 +0800, Herbert Xu wrote: > > > > We could easily fix that by adding a feature bit to control this, > > something like SKB_GSO_TCP_FIXEDID. > > I understood the patch allowed to

Re: [net PATCH 2/2] ipv4/GRO: Make GRO conform to RFC 6864

2016-04-01 Thread Herbert Xu
Eric Dumazet <eric.duma...@gmail.com> wrote: > > I do not particularly care, but it is worth mentioning that GRO+TSO > would not be idempotent anymore. We could easily fix that by adding a feature bit to control this, something like SKB_GSO_TCP_FIXEDID. Cheers, -- Email: H

Re: Question on rhashtable in worst-case scenario.

2016-04-01 Thread Herbert Xu
il > hitting a certain number of identical keys, surely that's just me not > understanding the code rather than anything else :) It's really simple, rhashtable_insert_fast does not check for dups while rhashtable_lookup_insert_* do. Cheers, -- Email: Herbert Xu <herb...@gondo

Re: Question on rhashtable in worst-case scenario.

2016-03-31 Thread Herbert Xu
urring, unless your chain-length exceeds 2^32. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: Question on rhashtable in worst-case scenario.

2016-03-31 Thread Herbert Xu
; is, after all, very much a case that "normal" operation doesn't even > get close to. I think you should just turn it on everywhere for mac80211. Chain length checks simply don't make sense when you allow duplicate keys in the hash table. Cheers, -- Email: Herbert Xu <herb...

Re: Question on rhashtable in worst-case scenario.

2016-03-30 Thread Herbert Xu
struct your own linked list for objects with the same key outside of rhashtable and hash the list instead. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: Question on rhashtable in worst-case scenario.

2016-03-30 Thread Herbert Xu
to do this, then we have the parameter insecure_elasticity that you can use to disable the rehashing based on chain length. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net v2] xfrm: Fix crash observed during device unregistration and decryption

2016-03-23 Thread Herbert Xu
ueue_to_backlog tests. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net v2] xfrm: Fix crash observed during device unregistration and decryption

2016-03-23 Thread Herbert Xu
so you'll just have to wait it out. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] xfrm: don't segment UFO packets

2016-03-19 Thread Herbert Xu
what you really want? If I understood you correctly, you want the fragmentation to occur after IPsec. So while this might generate the same output, it is still going to prefragment the data, only to merge them back for IPsec and then refragment again. Cheers, -- Email: Herbert Xu <herb...@gondor

Re: [PATCH] xfrm: don't segment UFO packets

2016-03-19 Thread Herbert Xu
..@suse.cz> Fair enough. But I wonder if this is enough. Wouldn't UDP notice that we're doing IPsec and prefragment the packet anyway? So I think this check may also be needed in the UDP output path. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.

Re: [RFC] xfrm: netdevice unregistration during decryption

2016-03-08 Thread Herbert Xu
for synchronous processing so you can't just change it to netif_rx_ni unconditionally. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v3] net:Add sysctl_max_skb_frags

2016-02-03 Thread Herbert Xu
why couldn't we do that? IOW let's handle this craziness in the crazy drivers and not in the general stack. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> 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   >