* [PATCH] apparmor: Force type-casting of current->real_cred
@ 2019-04-23 16:53 Bharath Vedartham
2019-05-07 19:53 ` John Johansen
0 siblings, 1 reply; 2+ messages in thread
From: Bharath Vedartham @ 2019-04-23 16:53 UTC (permalink / raw)
To: john.johansen, jmorris, serge; +Cc: linux-security-module, linux-kernel
This patch fixes the sparse warning:
warning: cast removes address space '<asn:4>' of expression.
Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com>
---
security/apparmor/lsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 87500bd..36478c4 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -1529,7 +1529,7 @@ static int param_set_mode(const char *val, const struct kernel_param *kp)
*/
static int __init set_init_ctx(void)
{
- struct cred *cred = (struct cred *)current->real_cred;
+ struct cred *cred = (__force struct cred *)current->real_cred;
set_cred_label(cred, aa_get_label(ns_unconfined(root_ns)));
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] apparmor: Force type-casting of current->real_cred
2019-04-23 16:53 [PATCH] apparmor: Force type-casting of current->real_cred Bharath Vedartham
@ 2019-05-07 19:53 ` John Johansen
0 siblings, 0 replies; 2+ messages in thread
From: John Johansen @ 2019-05-07 19:53 UTC (permalink / raw)
To: Bharath Vedartham, jmorris, serge; +Cc: linux-security-module, linux-kernel
On 4/23/19 9:53 AM, Bharath Vedartham wrote:
> This patch fixes the sparse warning:
> warning: cast removes address space '<asn:4>' of expression.
>
> Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com>
Acked-by: John Johansen <john.johansen@canonical.com>
I will pull this into my tree
> ---
> security/apparmor/lsm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
> index 87500bd..36478c4 100644
> --- a/security/apparmor/lsm.c
> +++ b/security/apparmor/lsm.c
> @@ -1529,7 +1529,7 @@ static int param_set_mode(const char *val, const struct kernel_param *kp)
> */
> static int __init set_init_ctx(void)
> {
> - struct cred *cred = (struct cred *)current->real_cred;
> + struct cred *cred = (__force struct cred *)current->real_cred;
>
> set_cred_label(cred, aa_get_label(ns_unconfined(root_ns)));
>
>
Acked-by: John Johansen <john.johansen@canonical.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-07 19:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 16:53 [PATCH] apparmor: Force type-casting of current->real_cred Bharath Vedartham
2019-05-07 19:53 ` John Johansen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).