[PATCH v2] audit: use proper refcount locking on audit_sock

2016-12-12 Thread Richard Guy Briggs
Resetting audit_sock appears to be racy. audit_sock was being copied and dereferenced without using a refcount on the source sock. Bump the refcount on the underlying sock when we store a refrence in audit_sock and release it when we reset audit_sock. audit_sock modification needs the audit_cmd_

Re: [PATCH v2] audit: use proper refcount locking on audit_sock

2016-12-12 Thread Paul Moore
On Mon, Dec 12, 2016 at 5:03 AM, Richard Guy Briggs wrote: > Resetting audit_sock appears to be racy. > > audit_sock was being copied and dereferenced without using a refcount on > the source sock. > > Bump the refcount on the underlying sock when we store a refrence in > audit_sock and release it

Re: [PATCH v2] audit: use proper refcount locking on audit_sock

2016-12-12 Thread Paul Moore
On Mon, Dec 12, 2016 at 5:03 AM, Richard Guy Briggs wrote: > Resetting audit_sock appears to be racy. > > audit_sock was being copied and dereferenced without using a refcount on > the source sock. > > Bump the refcount on the underlying sock when we store a refrence in > audit_sock and release it

Re: [PATCH v2] audit: use proper refcount locking on audit_sock

2016-12-12 Thread Cong Wang
On Mon, Dec 12, 2016 at 2:03 AM, Richard Guy Briggs wrote: > Resetting audit_sock appears to be racy. > > audit_sock was being copied and dereferenced without using a refcount on > the source sock. > > Bump the refcount on the underlying sock when we store a refrence in > audit_sock and release it

Re: [PATCH v2] audit: use proper refcount locking on audit_sock

2016-12-12 Thread Richard Guy Briggs
On 2016-12-12 12:10, Paul Moore wrote: > On Mon, Dec 12, 2016 at 5:03 AM, Richard Guy Briggs wrote: > > Resetting audit_sock appears to be racy. > > > > audit_sock was being copied and dereferenced without using a refcount on > > the source sock. > > > > Bump the refcount on the underlying sock wh

Re: [PATCH v2] audit: use proper refcount locking on audit_sock

2016-12-12 Thread Richard Guy Briggs
On 2016-12-12 15:18, Paul Moore wrote: > On Mon, Dec 12, 2016 at 5:03 AM, Richard Guy Briggs wrote: > > Resetting audit_sock appears to be racy. > > > > audit_sock was being copied and dereferenced without using a refcount on > > the source sock. > > > > Bump the refcount on the underlying sock wh

Re: [PATCH v2] audit: use proper refcount locking on audit_sock

2016-12-13 Thread Richard Guy Briggs
On 2016-12-12 15:58, Cong Wang wrote: > On Mon, Dec 12, 2016 at 2:03 AM, Richard Guy Briggs wrote: > > Resetting audit_sock appears to be racy. > > > > audit_sock was being copied and dereferenced without using a refcount on > > the source sock. > > > > Bump the refcount on the underlying sock whe

Re: [PATCH v2] audit: use proper refcount locking on audit_sock

2016-12-13 Thread Richard Guy Briggs
On 2016-12-13 00:10, Richard Guy Briggs wrote: > On 2016-12-12 15:18, Paul Moore wrote: > > On Mon, Dec 12, 2016 at 5:03 AM, Richard Guy Briggs wrote: > > > Resetting audit_sock appears to be racy. > > > > > > audit_sock was being copied and dereferenced without using a refcount on > > > the sourc