Re: [RFC PATCH 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic

2020-09-23 Thread Kees Cook
On Wed, Sep 23, 2020 at 09:31:34PM +0200, Greg KH wrote: > On Wed, Sep 23, 2020 at 12:04:58PM -0700, Kees Cook wrote: > > On Wed, Sep 23, 2020 at 07:10:27AM +0200, Greg KH wrote: > > > On Tue, Sep 22, 2020 at 07:43:36PM -0600, Shuah Khan wrote: > > > > struct binder_stats { > > > > -

Re: [RFC PATCH 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic

2020-09-23 Thread Greg KH
On Wed, Sep 23, 2020 at 12:04:58PM -0700, Kees Cook wrote: > On Wed, Sep 23, 2020 at 07:10:27AM +0200, Greg KH wrote: > > On Tue, Sep 22, 2020 at 07:43:36PM -0600, Shuah Khan wrote: > > > counter_atomic is introduced to be used when a variable is used as > > > a simple counter and doesn't guard

Re: [RFC PATCH 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic

2020-09-23 Thread Kees Cook
On Wed, Sep 23, 2020 at 07:10:27AM +0200, Greg KH wrote: > On Tue, Sep 22, 2020 at 07:43:36PM -0600, Shuah Khan wrote: > > counter_atomic is introduced to be used when a variable is used as > > a simple counter and doesn't guard object lifetimes. This clearly > > differentiates atomic_t usages

Re: [RFC PATCH 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic

2020-09-22 Thread Greg KH
On Tue, Sep 22, 2020 at 07:43:36PM -0600, Shuah Khan wrote: > counter_atomic is introduced to be used when a variable is used as > a simple counter and doesn't guard object lifetimes. This clearly > differentiates atomic_t usages that guard object lifetimes. > > counter_atomic variables will wrap

[RFC PATCH 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic

2020-09-22 Thread Shuah Khan
counter_atomic is introduced to be used when a variable is used as a simple counter and doesn't guard object lifetimes. This clearly differentiates atomic_t usages that guard object lifetimes. counter_atomic variables will wrap around to 0 when it overflows and should not be used to guard