Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1398165 > unrolled thread
| Started by | Julien Grall <julien.grall@arm.com> |
|---|---|
| First post | 2016-05-10 16:50 +0200 |
| Last post | 2016-05-11 11:50 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str Julien Grall <julien.grall@arm.com> - 2016-05-10 16:50 +0200
Re: [PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str Mark Rutland <mark.rutland@arm.com> - 2016-05-10 17:00 +0200
Re: [PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str Julien Grall <julien.grall@arm.com> - 2016-05-11 11:40 +0200
Re: [PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str Will Deacon <will.deacon@arm.com> - 2016-05-11 11:50 +0200
| From | Julien Grall <julien.grall@arm.com> |
|---|---|
| Date | 2016-05-10 16:50 +0200 |
| Subject | [PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str |
| Message-ID | <rxh90-4bJ-7@gated-at.bofh.it> |
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.
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>
---
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
[toc] | [next] | [standalone]
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2016-05-10 17:00 +0200 |
| Subject | Re: [PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str |
| Message-ID | <rxhiG-4hZ-15@gated-at.bofh.it> |
| In reply to | #1398165 |
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
>
[toc] | [prev] | [next] | [standalone]
| From | Julien Grall <julien.grall@arm.com> |
|---|---|
| Date | 2016-05-11 11:40 +0200 |
| Subject | Re: [PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str |
| Message-ID | <rxyMz-5vM-37@gated-at.bofh.it> |
| In reply to | #1398175 |
Hi Mark,
On 10/05/2016 15:54, Mark Rutland wrote:
> 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.
I can resend the patch with this changes.
>
>> 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.
It is an habit I have with Xen-devel as the Cc are not necessary after
it has been committed.
>
> Otherwise:
>
> Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Thank you!
Regards,
--
Julien Grall
[toc] | [prev] | [next] | [standalone]
| From | Will Deacon <will.deacon@arm.com> |
|---|---|
| Date | 2016-05-11 11:50 +0200 |
| Subject | Re: [PATCH] arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str |
| Message-ID | <rxyWf-5Bh-41@gated-at.bofh.it> |
| In reply to | #1398868 |
On Wed, May 11, 2016 at 10:38:36AM +0100, Julien Grall wrote:
> Hi Mark,
>
> On 10/05/2016 15:54, Mark Rutland wrote:
> >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.
>
> I can resend the patch with this changes.
No need, I've already applied it locally with Mark's suggestions.
Will
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web