Re: iwm(4): fix ccmp decrypt edge cases

2019-08-16 Thread Stefan Sperling
On Fri, Aug 16, 2019 at 10:11:55PM +1200, richard.n.proc...@gmail.com wrote: > See below for updated diff. Nice idea to add a panic on encrypt. > Also I've followed the existing idiom of m_freem(m0); return NULL; > > I've checked that all assignments to k_flags are to fresh keys; the new >

Re: iwm(4): fix ccmp decrypt edge cases

2019-08-16 Thread richard . n . procter
On Thu, 15 Aug 2019, Stefan Sperling wrote: > On Thu, Aug 15, 2019 at 03:47:02PM +1200, richard.n.proc...@gmail.com wrote: > > > I agree we should handle a missing key but suggest an alternative > > > approach > > > below. > > Hmm... your patch is surprisingly simple. I like it :) > > I am

Re: iwm(4): fix ccmp decrypt edge cases

2019-08-15 Thread Stefan Sperling
On Thu, Aug 15, 2019 at 03:47:02PM +1200, richard.n.proc...@gmail.com wrote: > On Thu, 15 Aug 2019, richard.n.proc...@gmail.com wrote: > > > On Tue, Aug 13, 2019 at 10:47:24AM -0300, Martin Pieuchot wrote: > > > > if the crash is because of a missing key, put one :) > > > > > > Yes, you've

Re: iwm(4): fix ccmp decrypt edge cases

2019-08-14 Thread richard . n . procter
On Thu, 15 Aug 2019, richard.n.proc...@gmail.com wrote: > Hi Stefan, > > On Wed, 14 Aug 2019, Stefan Sperling wrote: > > > On Tue, Aug 13, 2019 at 10:47:24AM -0300, Martin Pieuchot wrote: > > > if the crash is because of a missing key, put one :) > > > > Yes, you've convinced me. With this

Re: iwm(4): fix ccmp decrypt edge cases

2019-08-14 Thread richard . n . procter
Hi Stefan, On Wed, 14 Aug 2019, Stefan Sperling wrote: > On Tue, Aug 13, 2019 at 10:47:24AM -0300, Martin Pieuchot wrote: > > if the crash is because of a missing key, put one :) > > Yes, you've convinced me. With this patch we install the CCMP key > to both firmware and net80211. Until

Re: iwm(4): fix ccmp decrypt edge cases

2019-08-14 Thread Stefan Sperling
On Tue, Aug 13, 2019 at 10:47:24AM -0300, Martin Pieuchot wrote: > if the crash is because of a missing key, put one :) Yes, you've convinced me. With this patch we install the CCMP key to both firmware and net80211. Until firmware confirms that the key has been installed, we do software

Re: iwm(4): fix ccmp decrypt edge cases

2019-08-13 Thread Jesper Wallin
Hi, (cc'ed to bugs@ as well) On Tue, Aug 13, 2019 at 02:58:05PM +0200, Stefan Sperling wrote: > On Tue, Aug 13, 2019 at 09:40:22AM -0300, Martin Pieuchot wrote: > > > > How does the stack crashes? > > Jesper only sent me a screen shot and no public bug report :( > I've had a really busy week

Re: iwm(4): fix ccmp decrypt edge cases

2019-08-13 Thread Martin Pieuchot
On 13/08/19(Tue) 14:58, Stefan Sperling wrote: > On Tue, Aug 13, 2019 at 09:40:22AM -0300, Martin Pieuchot wrote: > > On 13/08/19(Tue) 13:52, Stefan Sperling wrote: > > > This should hopefully prevent a crash reported to me by Jesper Wallin, > > > where net80211 crashes when it attempts to decrypt

Re: iwm(4): fix ccmp decrypt edge cases

2019-08-13 Thread Stefan Sperling
On Tue, Aug 13, 2019 at 09:40:22AM -0300, Martin Pieuchot wrote: > On 13/08/19(Tue) 13:52, Stefan Sperling wrote: > > This should hopefully prevent a crash reported to me by Jesper Wallin, > > where net80211 crashes when it attempts to decrypt a CCMP-encrypted > > frame which iwm passed up without

Re: iwm(4): fix ccmp decrypt edge cases

2019-08-13 Thread Martin Pieuchot
On 13/08/19(Tue) 13:52, Stefan Sperling wrote: > This should hopefully prevent a crash reported to me by Jesper Wallin, > where net80211 crashes when it attempts to decrypt a CCMP-encrypted > frame which iwm passed up without decrypting it first. How does the stack crashes? Shouldn't we drop

iwm(4): fix ccmp decrypt edge cases

2019-08-13 Thread Stefan Sperling
This should hopefully prevent a crash reported to me by Jesper Wallin, where net80211 crashes when it attempts to decrypt a CCMP-encrypted frame which iwm passed up without decrypting it first. By code inspection I have determined that this problem could happen in case a CCMP frame is received