Re: [PATCH] cred: Use RCU primitives to access RCU pointers

From: David Howells
Date: Tue Jan 28 2020 - 10:00:24 EST


Amol Grover <frextrite@xxxxxxxxx> wrote:

> task_struct.cred and task_struct.real_cred are annotated by __rcu,
> hence use rcu_access_pointer to access them.
>
> Fixes the following sparse errors:
> kernel/cred.c:144:9: error: incompatible types in comparison expression
> (different address spaces):
> kernel/cred.c:144:9: struct cred *
> kernel/cred.c:144:9: struct cred const [noderef] <asn:4> *
> kernel/cred.c:145:9: error: incompatible types in comparison expression
> (different address spaces):
> kernel/cred.c:145:9: struct cred *
> kernel/cred.c:145:9: struct cred const [noderef] <asn:4> *
>
> Signed-off-by: Amol Grover <frextrite@xxxxxxxxx>

Reviewed-by: David Howells <dhowells@xxxxxxxxxx>