linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] security/keys: Remove inconsistent __user annotation
@ 2022-09-07 12:12 Vincenzo Frascino
  2022-09-07 14:05 ` Randy Dunlap
  2022-09-08  5:08 ` Jarkko Sakkinen
  0 siblings, 2 replies; 7+ messages in thread
From: Vincenzo Frascino @ 2022-09-07 12:12 UTC (permalink / raw)
  To: linux-security-module, linux-kernel
  Cc: Vincenzo Frascino, David Howells, Jarkko Sakkinen, Paul Moore,
	James Morris

The declaration of keyring_read does not match the definition
(security/keys/keyring.c). In this case the definition is correct
because it matches what defined in "struct key_type::read"
(linux/key-type.h).

Fix the declaration removing the inconsistent __user annotation.

Cc: David Howells <dhowells@redhat.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Paul Moore <paul@paul-moore.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
Note: This issue was discovered during the porting of the linux kernel
on Morello [1].

[1] https://git.morello-project.org/morello/kernel/linux

 security/keys/keyring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index 5e6a90760753..4448758f643a 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -79,7 +79,7 @@ static void keyring_revoke(struct key *keyring);
 static void keyring_destroy(struct key *keyring);
 static void keyring_describe(const struct key *keyring, struct seq_file *m);
 static long keyring_read(const struct key *keyring,
-			 char __user *buffer, size_t buflen);
+			 char *buffer, size_t buflen);
 
 struct key_type key_type_keyring = {
 	.name		= "keyring",
-- 
2.37.3


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

* Re: [PATCH] security/keys: Remove inconsistent __user annotation
  2022-09-07 12:12 [PATCH] security/keys: Remove inconsistent __user annotation Vincenzo Frascino
@ 2022-09-07 14:05 ` Randy Dunlap
  2022-09-07 15:43   ` Paul Moore
  2022-09-08  5:15   ` Jarkko Sakkinen
  2022-09-08  5:08 ` Jarkko Sakkinen
  1 sibling, 2 replies; 7+ messages in thread
From: Randy Dunlap @ 2022-09-07 14:05 UTC (permalink / raw)
  To: Vincenzo Frascino, linux-security-module, linux-kernel
  Cc: David Howells, Jarkko Sakkinen, Paul Moore, James Morris



On 9/7/22 05:12, Vincenzo Frascino wrote:
> The declaration of keyring_read does not match the definition
> (security/keys/keyring.c). In this case the definition is correct
> because it matches what defined in "struct key_type::read"
> (linux/key-type.h).
> 
> Fix the declaration removing the inconsistent __user annotation.
> 
> Cc: David Howells <dhowells@redhat.com>
> Cc: Jarkko Sakkinen <jarkko@kernel.org>
> Cc: Paul Moore <paul@paul-moore.com>
> Cc: James Morris <jmorris@namei.org>
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> ---
> Note: This issue was discovered during the porting of the linux kernel
> on Morello [1].
> 
> [1] https://git.morello-project.org/morello/kernel/linux

FTR, I have sent this same patch 3 times.
Good luck.

>  security/keys/keyring.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/keys/keyring.c b/security/keys/keyring.c
> index 5e6a90760753..4448758f643a 100644
> --- a/security/keys/keyring.c
> +++ b/security/keys/keyring.c
> @@ -79,7 +79,7 @@ static void keyring_revoke(struct key *keyring);
>  static void keyring_destroy(struct key *keyring);
>  static void keyring_describe(const struct key *keyring, struct seq_file *m);
>  static long keyring_read(const struct key *keyring,
> -			 char __user *buffer, size_t buflen);
> +			 char *buffer, size_t buflen);
>  
>  struct key_type key_type_keyring = {
>  	.name		= "keyring",

-- 
~Randy

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

* Re: [PATCH] security/keys: Remove inconsistent __user annotation
  2022-09-07 14:05 ` Randy Dunlap
@ 2022-09-07 15:43   ` Paul Moore
  2022-09-08  5:17     ` Jarkko Sakkinen
  2022-09-08  5:15   ` Jarkko Sakkinen
  1 sibling, 1 reply; 7+ messages in thread
From: Paul Moore @ 2022-09-07 15:43 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Vincenzo Frascino, linux-security-module, linux-kernel,
	David Howells, Jarkko Sakkinen, James Morris

On Wed, Sep 7, 2022 at 10:06 AM Randy Dunlap <rdunlap@infradead.org> wrote:
> On 9/7/22 05:12, Vincenzo Frascino wrote:
> > The declaration of keyring_read does not match the definition
> > (security/keys/keyring.c). In this case the definition is correct
> > because it matches what defined in "struct key_type::read"
> > (linux/key-type.h).
> >
> > Fix the declaration removing the inconsistent __user annotation.
> >
> > Cc: David Howells <dhowells@redhat.com>
> > Cc: Jarkko Sakkinen <jarkko@kernel.org>
> > Cc: Paul Moore <paul@paul-moore.com>
> > Cc: James Morris <jmorris@namei.org>
> > Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> > ---
> > Note: This issue was discovered during the porting of the linux kernel
> > on Morello [1].
> >
> > [1] https://git.morello-project.org/morello/kernel/linux
>
> FTR, I have sent this same patch 3 times.
> Good luck.

David or Jarkko, this patch is both trivial and obviously correct,
please merge this into the keys tree for the next merge window else
I'll take it via the LSM tree.

Reviewed-by: Paul Moore <paul@paul-moore.com>

> >  security/keys/keyring.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/security/keys/keyring.c b/security/keys/keyring.c
> > index 5e6a90760753..4448758f643a 100644
> > --- a/security/keys/keyring.c
> > +++ b/security/keys/keyring.c
> > @@ -79,7 +79,7 @@ static void keyring_revoke(struct key *keyring);
> >  static void keyring_destroy(struct key *keyring);
> >  static void keyring_describe(const struct key *keyring, struct seq_file *m);
> >  static long keyring_read(const struct key *keyring,
> > -                      char __user *buffer, size_t buflen);
> > +                      char *buffer, size_t buflen);
> >
> >  struct key_type key_type_keyring = {
> >       .name           = "keyring",

-- 
paul-moore.com

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

* Re: [PATCH] security/keys: Remove inconsistent __user annotation
  2022-09-07 12:12 [PATCH] security/keys: Remove inconsistent __user annotation Vincenzo Frascino
  2022-09-07 14:05 ` Randy Dunlap
@ 2022-09-08  5:08 ` Jarkko Sakkinen
  1 sibling, 0 replies; 7+ messages in thread
From: Jarkko Sakkinen @ 2022-09-08  5:08 UTC (permalink / raw)
  To: Vincenzo Frascino
  Cc: linux-security-module, linux-kernel, David Howells, Paul Moore,
	James Morris

On Wed, Sep 07, 2022 at 01:12:30PM +0100, Vincenzo Frascino wrote:
> The declaration of keyring_read does not match the definition
> (security/keys/keyring.c). In this case the definition is correct
> because it matches what defined in "struct key_type::read"
> (linux/key-type.h).
> 
> Fix the declaration removing the inconsistent __user annotation.
> 
> Cc: David Howells <dhowells@redhat.com>
> Cc: Jarkko Sakkinen <jarkko@kernel.org>
> Cc: Paul Moore <paul@paul-moore.com>
> Cc: James Morris <jmorris@namei.org>
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> ---
> Note: This issue was discovered during the porting of the linux kernel
> on Morello [1].
> 
> [1] https://git.morello-project.org/morello/kernel/linux
> 
>  security/keys/keyring.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/keys/keyring.c b/security/keys/keyring.c
> index 5e6a90760753..4448758f643a 100644
> --- a/security/keys/keyring.c
> +++ b/security/keys/keyring.c
> @@ -79,7 +79,7 @@ static void keyring_revoke(struct key *keyring);
>  static void keyring_destroy(struct key *keyring);
>  static void keyring_describe(const struct key *keyring, struct seq_file *m);
>  static long keyring_read(const struct key *keyring,
> -			 char __user *buffer, size_t buflen);
> +			 char *buffer, size_t buflen);
>  
>  struct key_type key_type_keyring = {
>  	.name		= "keyring",
> -- 
> 2.37.3
> 

Acked-by: Jarkko Sakkinen <jarkko@kernel.org>

BR, Jarkko

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

* Re: [PATCH] security/keys: Remove inconsistent __user annotation
  2022-09-07 14:05 ` Randy Dunlap
  2022-09-07 15:43   ` Paul Moore
@ 2022-09-08  5:15   ` Jarkko Sakkinen
  1 sibling, 0 replies; 7+ messages in thread
From: Jarkko Sakkinen @ 2022-09-08  5:15 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Vincenzo Frascino, linux-security-module, linux-kernel,
	David Howells, Paul Moore, James Morris

On Wed, Sep 07, 2022 at 07:05:55AM -0700, Randy Dunlap wrote:
> 
> 
> On 9/7/22 05:12, Vincenzo Frascino wrote:
> > The declaration of keyring_read does not match the definition
> > (security/keys/keyring.c). In this case the definition is correct
> > because it matches what defined in "struct key_type::read"
> > (linux/key-type.h).
> > 
> > Fix the declaration removing the inconsistent __user annotation.
> > 
> > Cc: David Howells <dhowells@redhat.com>
> > Cc: Jarkko Sakkinen <jarkko@kernel.org>
> > Cc: Paul Moore <paul@paul-moore.com>
> > Cc: James Morris <jmorris@namei.org>
> > Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> > ---
> > Note: This issue was discovered during the porting of the linux kernel
> > on Morello [1].
> > 
> > [1] https://git.morello-project.org/morello/kernel/linux
> 
> FTR, I have sent this same patch 3 times.
> Good luck.
> 
Right.

I'll pick this to my tree https://lore.kernel.org/keyrings/20220830191940.1498-1-rdunlap@infradead.org/

And need to clearly sync up better with David.

BR, Jarkko

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

* Re: [PATCH] security/keys: Remove inconsistent __user annotation
  2022-09-07 15:43   ` Paul Moore
@ 2022-09-08  5:17     ` Jarkko Sakkinen
  2022-09-08 14:47       ` Paul Moore
  0 siblings, 1 reply; 7+ messages in thread
From: Jarkko Sakkinen @ 2022-09-08  5:17 UTC (permalink / raw)
  To: Paul Moore
  Cc: Randy Dunlap, Vincenzo Frascino, linux-security-module,
	linux-kernel, David Howells, James Morris

On Wed, Sep 07, 2022 at 11:43:17AM -0400, Paul Moore wrote:
> On Wed, Sep 7, 2022 at 10:06 AM Randy Dunlap <rdunlap@infradead.org> wrote:
> > On 9/7/22 05:12, Vincenzo Frascino wrote:
> > > The declaration of keyring_read does not match the definition
> > > (security/keys/keyring.c). In this case the definition is correct
> > > because it matches what defined in "struct key_type::read"
> > > (linux/key-type.h).
> > >
> > > Fix the declaration removing the inconsistent __user annotation.
> > >
> > > Cc: David Howells <dhowells@redhat.com>
> > > Cc: Jarkko Sakkinen <jarkko@kernel.org>
> > > Cc: Paul Moore <paul@paul-moore.com>
> > > Cc: James Morris <jmorris@namei.org>
> > > Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> > > ---
> > > Note: This issue was discovered during the porting of the linux kernel
> > > on Morello [1].
> > >
> > > [1] https://git.morello-project.org/morello/kernel/linux
> >
> > FTR, I have sent this same patch 3 times.
> > Good luck.
> 
> David or Jarkko, this patch is both trivial and obviously correct,
> please merge this into the keys tree for the next merge window else
> I'll take it via the LSM tree.
> 
> Reviewed-by: Paul Moore <paul@paul-moore.com>

I picked it to my tree.

BR, Jarkko

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

* Re: [PATCH] security/keys: Remove inconsistent __user annotation
  2022-09-08  5:17     ` Jarkko Sakkinen
@ 2022-09-08 14:47       ` Paul Moore
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Moore @ 2022-09-08 14:47 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Randy Dunlap, Vincenzo Frascino, linux-security-module,
	linux-kernel, David Howells, James Morris

On Thu, Sep 8, 2022 at 1:17 AM Jarkko Sakkinen <jarkko@kernel.org> wrote:
> On Wed, Sep 07, 2022 at 11:43:17AM -0400, Paul Moore wrote:
> > On Wed, Sep 7, 2022 at 10:06 AM Randy Dunlap <rdunlap@infradead.org> wrote:
> > > On 9/7/22 05:12, Vincenzo Frascino wrote:
> > > > The declaration of keyring_read does not match the definition
> > > > (security/keys/keyring.c). In this case the definition is correct
> > > > because it matches what defined in "struct key_type::read"
> > > > (linux/key-type.h).
> > > >
> > > > Fix the declaration removing the inconsistent __user annotation.
> > > >
> > > > Cc: David Howells <dhowells@redhat.com>
> > > > Cc: Jarkko Sakkinen <jarkko@kernel.org>
> > > > Cc: Paul Moore <paul@paul-moore.com>
> > > > Cc: James Morris <jmorris@namei.org>
> > > > Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> > > > ---
> > > > Note: This issue was discovered during the porting of the linux kernel
> > > > on Morello [1].
> > > >
> > > > [1] https://git.morello-project.org/morello/kernel/linux
> > >
> > > FTR, I have sent this same patch 3 times.
> > > Good luck.
> >
> > David or Jarkko, this patch is both trivial and obviously correct,
> > please merge this into the keys tree for the next merge window else
> > I'll take it via the LSM tree.
> >
> > Reviewed-by: Paul Moore <paul@paul-moore.com>
>
> I picked it to my tree.

Thanks Jarkko.

-- 
paul-moore.com

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

end of thread, other threads:[~2022-09-08 14:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 12:12 [PATCH] security/keys: Remove inconsistent __user annotation Vincenzo Frascino
2022-09-07 14:05 ` Randy Dunlap
2022-09-07 15:43   ` Paul Moore
2022-09-08  5:17     ` Jarkko Sakkinen
2022-09-08 14:47       ` Paul Moore
2022-09-08  5:15   ` Jarkko Sakkinen
2022-09-08  5:08 ` Jarkko Sakkinen

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