[PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str

Mark Rutland mark.rutland at arm.com
Tue May 10 07:54:41 PDT 2016


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 at arm.com>
> Cc: stable at vger.kernel.org
> 
> ---
> 
> Cc: Mark Rutland <mark.rutland at arm.com>
> Cc: Suzuki K. Poulose <suzuki.poulose at arm.com>
> ---

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

Otherwise:

Reviewed-by: Mark Rutland <mark.rutland at 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
> 



More information about the linux-arm-kernel mailing list