Re: [PATCH] crypto: Fix race around ctx->rcvused by making it atomic_t

2017-12-22 Thread Herbert Xu
On Tue, Dec 19, 2017 at 10:31:22AM +, Jonathan Cameron wrote: > This variable was increased and decreased without any protection. > Result was an occasional misscount and negative wrap around resulting > in false resource allocation failures. > > Signed-off-by: Jonathan Cameron > Fixes: 2d975

Re: [PATCH] crypto: Fix race around ctx->rcvused by making it atomic_t

2017-12-21 Thread Herbert Xu
On Fri, Dec 22, 2017 at 08:50:01AM +0100, Stephan Mueller wrote: > Am Freitag, 22. Dezember 2017, 08:48:03 CET schrieb Herbert Xu: > > Hi Herbert, > > > On Tue, Dec 19, 2017 at 10:31:22AM +, Jonathan Cameron wrote: > > > This variable was increased and decreased without any protection. > > >

Re: [PATCH] crypto: Fix race around ctx->rcvused by making it atomic_t

2017-12-21 Thread Stephan Mueller
Am Freitag, 22. Dezember 2017, 08:48:03 CET schrieb Herbert Xu: Hi Herbert, > On Tue, Dec 19, 2017 at 10:31:22AM +, Jonathan Cameron wrote: > > This variable was increased and decreased without any protection. > > Result was an occasional misscount and negative wrap around resulting > > in fa

Re: [PATCH] crypto: Fix race around ctx->rcvused by making it atomic_t

2017-12-21 Thread Herbert Xu
On Tue, Dec 19, 2017 at 10:31:22AM +, Jonathan Cameron wrote: > This variable was increased and decreased without any protection. > Result was an occasional misscount and negative wrap around resulting > in false resource allocation failures. > > Signed-off-by: Jonathan Cameron > Fixes: 2d975

Re: [PATCH] crypto: Fix race around ctx->rcvused by making it atomic_t

2017-12-19 Thread Stephan Mueller
Am Dienstag, 19. Dezember 2017, 12:26:42 CET schrieb Jonathan Cameron: Hi Jonathan, > > > + atomic_set(&ctx->rcvused, 0); > > > > I think ATOMIC_INIT(0) is more suitable here. > > It's ugly to use it to assign a dynamic element like this. > > ctx->rcvused = (atomic_t)ATOMIC_INIT(0); You are r

Re: [PATCH] crypto: Fix race around ctx->rcvused by making it atomic_t

2017-12-19 Thread Jonathan Cameron
On Tue, 19 Dec 2017 12:11:19 +0100 Stephan Mueller wrote: > Am Dienstag, 19. Dezember 2017, 11:31:22 CET schrieb Jonathan Cameron: > > Hi Jonathan, > > > This variable was increased and decreased without any protection. > > Result was an occasional misscount and negative wrap around resulting >

Re: [PATCH] crypto: Fix race around ctx->rcvused by making it atomic_t

2017-12-19 Thread Stephan Mueller
Am Dienstag, 19. Dezember 2017, 11:31:22 CET schrieb Jonathan Cameron: Hi Jonathan, > This variable was increased and decreased without any protection. > Result was an occasional misscount and negative wrap around resulting > in false resource allocation failures. > > Signed-off-by: Jonathan Cam