linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] keys: fix missing __user in KEYCTL_PKEY_QUERY
@ 2019-03-01 11:30 Ben Dooks
  2019-03-01 22:28 ` Serge E. Hallyn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ben Dooks @ 2019-03-01 11:30 UTC (permalink / raw)
  To: keyrings
  Cc: linux-security-module, dhowells, jmorris, serge, linux-kernel, Ben Dooks

The arg5 of KEYCTL_PKEY_QUERY should have a __user pointer tag on
it as it is a user pointer. This clears the following sparse warning
for this:

security/keys/keyctl.c:1755:43: warning: incorrect type in argument 3 (different address spaces)
security/keys/keyctl.c:1755:43:    expected struct keyctl_pkey_query [noderef] <asn:1>*<noident>
security/keys/keyctl.c:1755:43:    got struct keyctl_pkey_query *<noident>

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 security/keys/keyctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 7bbe03593e58..3e4053a217c3 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -1752,7 +1752,7 @@ SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3,
 			return -EINVAL;
 		return keyctl_pkey_query((key_serial_t)arg2,
 					 (const char __user *)arg4,
-					 (struct keyctl_pkey_query *)arg5);
+					 (struct keyctl_pkey_query __user *)arg5);
 
 	case KEYCTL_PKEY_ENCRYPT:
 	case KEYCTL_PKEY_DECRYPT:
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] keys: fix missing __user in KEYCTL_PKEY_QUERY
  2019-03-01 11:30 [PATCH] keys: fix missing __user in KEYCTL_PKEY_QUERY Ben Dooks
@ 2019-03-01 22:28 ` Serge E. Hallyn
  2019-03-05  3:28 ` James Morris
  2019-03-05  7:41 ` David Howells
  2 siblings, 0 replies; 4+ messages in thread
From: Serge E. Hallyn @ 2019-03-01 22:28 UTC (permalink / raw)
  To: Ben Dooks
  Cc: keyrings, linux-security-module, dhowells, jmorris, serge, linux-kernel

On Fri, Mar 01, 2019 at 11:30:26AM +0000, Ben Dooks wrote:
> The arg5 of KEYCTL_PKEY_QUERY should have a __user pointer tag on
> it as it is a user pointer. This clears the following sparse warning
> for this:
> 
> security/keys/keyctl.c:1755:43: warning: incorrect type in argument 3 (different address spaces)
> security/keys/keyctl.c:1755:43:    expected struct keyctl_pkey_query [noderef] <asn:1>*<noident>
> security/keys/keyctl.c:1755:43:    got struct keyctl_pkey_query *<noident>
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Acked-by: Serge Hallyn <serge@hallyn.com>

> ---
>  security/keys/keyctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
> index 7bbe03593e58..3e4053a217c3 100644
> --- a/security/keys/keyctl.c
> +++ b/security/keys/keyctl.c
> @@ -1752,7 +1752,7 @@ SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3,
>  			return -EINVAL;
>  		return keyctl_pkey_query((key_serial_t)arg2,
>  					 (const char __user *)arg4,
> -					 (struct keyctl_pkey_query *)arg5);
> +					 (struct keyctl_pkey_query __user *)arg5);
>  
>  	case KEYCTL_PKEY_ENCRYPT:
>  	case KEYCTL_PKEY_DECRYPT:
> -- 
> 2.20.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] keys: fix missing __user in KEYCTL_PKEY_QUERY
  2019-03-01 11:30 [PATCH] keys: fix missing __user in KEYCTL_PKEY_QUERY Ben Dooks
  2019-03-01 22:28 ` Serge E. Hallyn
@ 2019-03-05  3:28 ` James Morris
  2019-03-05  7:41 ` David Howells
  2 siblings, 0 replies; 4+ messages in thread
From: James Morris @ 2019-03-05  3:28 UTC (permalink / raw)
  To: Ben Dooks; +Cc: keyrings, linux-security-module, dhowells, serge, linux-kernel

On Fri, 1 Mar 2019, Ben Dooks wrote:

> The arg5 of KEYCTL_PKEY_QUERY should have a __user pointer tag on
> it as it is a user pointer. This clears the following sparse warning
> for this:
> 
> security/keys/keyctl.c:1755:43: warning: incorrect type in argument 3 (different address spaces)
> security/keys/keyctl.c:1755:43:    expected struct keyctl_pkey_query [noderef] <asn:1>*<noident>
> security/keys/keyctl.c:1755:43:    got struct keyctl_pkey_query *<noident>
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-general

-- 
James Morris
<jmorris@namei.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] keys: fix missing __user in KEYCTL_PKEY_QUERY
  2019-03-01 11:30 [PATCH] keys: fix missing __user in KEYCTL_PKEY_QUERY Ben Dooks
  2019-03-01 22:28 ` Serge E. Hallyn
  2019-03-05  3:28 ` James Morris
@ 2019-03-05  7:41 ` David Howells
  2 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2019-03-05  7:41 UTC (permalink / raw)
  To: Ben Dooks
  Cc: dhowells, keyrings, linux-security-module, jmorris, serge, linux-kernel

Ben Dooks <ben.dooks@codethink.co.uk> wrote:

> The arg5 of KEYCTL_PKEY_QUERY should have a __user pointer tag on
> it as it is a user pointer. This clears the following sparse warning
> for this:
> 
> security/keys/keyctl.c:1755:43: warning: incorrect type in argument 3 (different address spaces)
> security/keys/keyctl.c:1755:43:    expected struct keyctl_pkey_query [noderef] <asn:1>*<noident>
> security/keys/keyctl.c:1755:43:    got struct keyctl_pkey_query *<noident>
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Acked-by: David Howells <dhowells@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-05  7:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01 11:30 [PATCH] keys: fix missing __user in KEYCTL_PKEY_QUERY Ben Dooks
2019-03-01 22:28 ` Serge E. Hallyn
2019-03-05  3:28 ` James Morris
2019-03-05  7:41 ` David Howells

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).