public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] apparmor: do not expose kernel stack
@ 2016-06-10 21:34 Heinrich Schuchardt
  2016-06-10 22:13 ` John Johansen
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2016-06-10 21:34 UTC (permalink / raw)
  To: John Johansen, James Morris, Serge E. Hallyn
  Cc: linux-security-module, linux-kernel, Heinrich Schuchardt

Do not copy uninitalized fields th.td_hilen, th.td_data.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 security/apparmor/match.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/security/apparmor/match.c b/security/apparmor/match.c
index 727eb42..1d6dbd8 100644
--- a/security/apparmor/match.c
+++ b/security/apparmor/match.c
@@ -61,7 +61,9 @@ static struct table_header *unpack_table(char *blob, size_t bsize)
 
 	table = kvzalloc(tsize);
 	if (table) {
-		*table = th;
+		table->td_id = th.td_id;
+		table->td_flags = th.td_flags;
+		table->td_lolen = th.td_lolen;
 		if (th.td_flags == YYTD_DATA8)
 			UNPACK_ARRAY(table->td_data, blob, th.td_lolen,
 				     u8, byte_to_byte);
-- 
2.1.4

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

* Re: [PATCH 1/1] apparmor: do not expose kernel stack
  2016-06-10 21:34 [PATCH 1/1] apparmor: do not expose kernel stack Heinrich Schuchardt
@ 2016-06-10 22:13 ` John Johansen
  0 siblings, 0 replies; 2+ messages in thread
From: John Johansen @ 2016-06-10 22:13 UTC (permalink / raw)
  To: Heinrich Schuchardt, James Morris, Serge E. Hallyn
  Cc: linux-security-module, linux-kernel

On 06/10/2016 02:34 PM, Heinrich Schuchardt wrote:
> Do not copy uninitalized fields th.td_hilen, th.td_data.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Acked-by: John Johansen <john.johansen@canonical.com>

I have a queue of patches I need to push this weekend so I
will suck this one in and send it up with the rest

> ---
>  security/apparmor/match.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/security/apparmor/match.c b/security/apparmor/match.c
> index 727eb42..1d6dbd8 100644
> --- a/security/apparmor/match.c
> +++ b/security/apparmor/match.c
> @@ -61,7 +61,9 @@ static struct table_header *unpack_table(char *blob, size_t bsize)
>  
>  	table = kvzalloc(tsize);
>  	if (table) {
> -		*table = th;
> +		table->td_id = th.td_id;
> +		table->td_flags = th.td_flags;
> +		table->td_lolen = th.td_lolen;
>  		if (th.td_flags == YYTD_DATA8)
>  			UNPACK_ARRAY(table->td_data, blob, th.td_lolen,
>  				     u8, byte_to_byte);
> 

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

end of thread, other threads:[~2016-06-10 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-10 21:34 [PATCH 1/1] apparmor: do not expose kernel stack Heinrich Schuchardt
2016-06-10 22:13 ` John Johansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox