From: Johannes Berg <johannes@sipsolutions.net>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Network Development <netdev@vger.kernel.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Linux Wireless List <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Jouni Malinen <j@w1.fi>
Subject: Re: [mac80211] BUG_ON with current -git (4.8.0-11417-g24532f7)
Date: Fri, 14 Oct 2016 10:28:19 +0200 [thread overview]
Message-ID: <1476433699.31114.6.camel@sipsolutions.net> (raw)
In-Reply-To: <1476429916.4382.12.camel@sipsolutions.net> (sfid-20161014_092541_208009_922C51BD)
> 1. revert that patch (doing so would need some major adjustments now,
> since it's pretty old and a number of new things were added in the
> meantime)
This it will have to be, I guess.
> 2. allocate a per-CPU buffer for all the things that we put on the
> stack and use in SG lists, those are:
> * CCM/GCM: AAD (32B), B_0/J_0 (16B)
> * GMAC: AAD (20B), zero (16B)
> * (not sure why CMAC isn't using this API, but it would be like GMAC)
This doesn't work - I tried to move the mac80211 buffers, but because
we also put the struct aead_request on the stack, and crypto_ccm has
the "odata" in there, and we can't separate the odata from that struct,
we'd have to also put that into a per-CPU buffer, but it's very big -
456 bytes for CCM, didn't measure the others but I'd expect them to be
larger, if different.
I don't think we can allocate half a kb for each CPU just to be able to
possibly use the acceleration here. We can't even make that conditional
on not having hardware crypto in the wifi NIC because drivers are
always allowed to pass undecrypted frames, regardless of whether or not
HW crypto was attempted, so we don't know upfront if we'll have to
decrypt anything in software...
Given that, I think we have had a bug in here basically since Ard's
patch, we never should've put these structs on the stack. Herbert, you
also touched this later and converted the API usage, did you see the
way the stack is used here and think it should be OK, or did you simply
not realize that?
Ard, are you able to help out working on a revert of your patch? That
would require also reverting a number of other patches (various fixes,
API adjustments, etc. to the AEAD usage), but the more complicated part
is that in the meantime Jouni introduced GCMP and CCMP-256, both of
which we of course need to retain.
johannes
next prev parent reply other threads:[~2016-10-14 8:28 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-10 15:03 [mac80211] BUG_ON with current -git (4.8.0-11417-g24532f7) Sergey Senozhatsky
2016-10-10 15:30 ` Sergey Senozhatsky
2016-10-12 9:05 ` Johannes Berg
2016-10-12 14:12 ` Sergey Senozhatsky
2016-10-12 14:22 ` Johannes Berg
2016-10-13 5:39 ` Andy Lutomirski
2016-10-13 6:02 ` Johannes Berg
2016-10-13 13:42 ` Sergey Senozhatsky
2016-10-13 13:45 ` Sergey Senozhatsky
2016-10-13 13:45 ` Johannes Berg
2016-10-13 15:00 ` Sergey Senozhatsky
2016-10-13 15:04 ` Sergey Senozhatsky
2016-10-13 21:49 ` Andy Lutomirski
2016-10-14 7:25 ` Johannes Berg
2016-10-14 8:28 ` Johannes Berg [this message]
2016-10-14 8:39 ` Ard Biesheuvel
2016-10-14 8:41 ` Ard Biesheuvel
2016-10-14 8:42 ` Johannes Berg
2016-10-14 8:47 ` Ard Biesheuvel
[not found] ` <CAKv+Gu896xme5sd5i8hs7tA=Xt=qQKCiAx7fQg1ZECn50NttbQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-14 8:55 ` Johannes Berg
2016-10-14 9:05 ` Ard Biesheuvel
2016-10-14 9:10 ` Johannes Berg
2016-10-14 9:21 ` Ard Biesheuvel
2016-10-14 9:25 ` Johannes Berg
2016-10-14 9:35 ` Ard Biesheuvel
2016-10-14 10:00 ` Johannes Berg
2016-10-14 11:11 ` Ard Biesheuvel
2016-10-14 8:53 ` Johannes Berg
2016-10-14 8:39 ` Sergey Senozhatsky
2016-10-14 8:45 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1476433699.31114.6.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=ard.biesheuvel@linaro.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=j@w1.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=netdev@vger.kernel.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=sergey.senozhatsky@gmail.com \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).