All of lore.kernel.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str
Date: Tue, 10 May 2016 15:54:41 +0100	[thread overview]
Message-ID: <20160510145441.GC10785@leverpostej> (raw)
In-Reply-To: <1462891231-17605-1-git-send-email-julien.grall@arm.com>

On Tue, May 10, 2016 at 03:40:31PM +0100, Julien Grall wrote:
> The loop that browses the array compat_hwcap_str will stop when a NULL
> is encountered, however NULL is missing at the end of array. This will
> result to overrun until one NULL is found somewhere in the memory.

Probably worth adding something like:

Note for backporting: commit 12d11817eaafa414 ("arm64: Move
/proc/cpuinfo handling code") moved this code. Prior to that commit, the
same change should be made in arch/arm64/kernel/setup.c.

> Fixes: 44b82b7700d0 "arm64: Fix up /proc/cpuinfo"
> Signed-off-by: Julien Grall <julien.grall@arm.com>
> Cc: stable at vger.kernel.org
> 
> ---
> 
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Suzuki K. Poulose <suzuki.poulose@arm.com>
> ---

Wierd middle '---' between the Cc lines above.

Otherwise:

Reviewed-by: Mark Rutland <mark.rutland@arm.com>

Thanks for fixing this, sorry for introducing it in the first place!

Mark.

>  arch/arm64/kernel/cpuinfo.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> index 84c8684..f0c3fb7 100644
> --- a/arch/arm64/kernel/cpuinfo.c
> +++ b/arch/arm64/kernel/cpuinfo.c
> @@ -87,7 +87,8 @@ static const char *const compat_hwcap_str[] = {
>  	"idivt",
>  	"vfpd32",
>  	"lpae",
> -	"evtstrm"
> +	"evtstrm",
> +	NULL
>  };
>  
>  static const char *const compat_hwcap2_str[] = {
> -- 
> 1.9.1
> 

WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: Julien Grall <julien.grall@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, will.deacon@arm.com,
	linux-kernel@vger.kernel.org, catalin.marinas@arm.com,
	stable@vger.kernel.org,
	"Suzuki K. Poulose" <suzuki.poulose@arm.com>
Subject: Re: [PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str
Date: Tue, 10 May 2016 15:54:41 +0100	[thread overview]
Message-ID: <20160510145441.GC10785@leverpostej> (raw)
In-Reply-To: <1462891231-17605-1-git-send-email-julien.grall@arm.com>

On Tue, May 10, 2016 at 03:40:31PM +0100, Julien Grall wrote:
> The loop that browses the array compat_hwcap_str will stop when a NULL
> is encountered, however NULL is missing at the end of array. This will
> result to overrun until one NULL is found somewhere in the memory.

Probably worth adding something like:

Note for backporting: commit 12d11817eaafa414 ("arm64: Move
/proc/cpuinfo handling code") moved this code. Prior to that commit, the
same change should be made in arch/arm64/kernel/setup.c.

> Fixes: 44b82b7700d0 "arm64: Fix up /proc/cpuinfo"
> Signed-off-by: Julien Grall <julien.grall@arm.com>
> Cc: stable@vger.kernel.org
> 
> ---
> 
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Suzuki K. Poulose <suzuki.poulose@arm.com>
> ---

Wierd middle '---' between the Cc lines above.

Otherwise:

Reviewed-by: Mark Rutland <mark.rutland@arm.com>

Thanks for fixing this, sorry for introducing it in the first place!

Mark.

>  arch/arm64/kernel/cpuinfo.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> index 84c8684..f0c3fb7 100644
> --- a/arch/arm64/kernel/cpuinfo.c
> +++ b/arch/arm64/kernel/cpuinfo.c
> @@ -87,7 +87,8 @@ static const char *const compat_hwcap_str[] = {
>  	"idivt",
>  	"vfpd32",
>  	"lpae",
> -	"evtstrm"
> +	"evtstrm",
> +	NULL
>  };
>  
>  static const char *const compat_hwcap2_str[] = {
> -- 
> 1.9.1
> 

  reply	other threads:[~2016-05-10 14:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 14:40 [PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str Julien Grall
2016-05-10 14:40 ` Julien Grall
2016-05-10 14:54 ` Mark Rutland [this message]
2016-05-10 14:54   ` Mark Rutland
2016-05-11  9:38   ` Julien Grall
2016-05-11  9:38     ` Julien Grall
2016-05-11  9:40     ` Will Deacon
2016-05-11  9:40       ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160510145441.GC10785@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.