diff mbox series

powerpc: Fix POWER10 selection

Message ID 20200715230448.229468-1-tuliom@linux.ibm.com
State New
Headers show
Series powerpc: Fix POWER10 selection | expand

Commit Message

Tulio Magno Quites Machado Filho July 15, 2020, 11:04 p.m. UTC
Add a line that was missing from a previous commit.
Without increasing str, the null-byte is not validated, and
_dl_string_platform returns -1.

Fixes: d2ba3677da7a ("powerpc: Add support for POWER10")
---
 sysdeps/powerpc/dl-procinfo.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Paul E Murphy July 16, 2020, 1:54 p.m. UTC | #1
On 7/15/20 6:04 PM, Tulio Magno Quites Machado Filho via Libc-alpha wrote:
> Add a line that was missing from a previous commit.
> Without increasing str, the null-byte is not validated, and
> _dl_string_platform returns -1.
> 
> Fixes: d2ba3677da7a ("powerpc: Add support for POWER10")
> ---
>   sysdeps/powerpc/dl-procinfo.h | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
> index 497dc568e9..f07500619a 100644
> --- a/sysdeps/powerpc/dl-procinfo.h
> +++ b/sysdeps/powerpc/dl-procinfo.h
> @@ -96,6 +96,7 @@ _dl_string_platform (const char *str)
>   	  if (str[1] == '0')
>   	    {
>   	      ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER10;
> +	      str++;
>   	    }
>   	  else
>   	    return -1;
> 

LGTM.
Carlos O'Donell July 16, 2020, 3:24 p.m. UTC | #2
On 7/16/20 9:54 AM, Paul E Murphy via Libc-alpha wrote:
> 
> 
> On 7/15/20 6:04 PM, Tulio Magno Quites Machado Filho via Libc-alpha wrote:
>> Add a line that was missing from a previous commit.
>> Without increasing str, the null-byte is not validated, and
>> _dl_string_platform returns -1.
>>
>> Fixes: d2ba3677da7a ("powerpc: Add support for POWER10")
>> ---
>>   sysdeps/powerpc/dl-procinfo.h | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
>> index 497dc568e9..f07500619a 100644
>> --- a/sysdeps/powerpc/dl-procinfo.h
>> +++ b/sysdeps/powerpc/dl-procinfo.h
>> @@ -96,6 +96,7 @@ _dl_string_platform (const char *str)
>>         if (str[1] == '0')
>>           {
>>             ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER10;
>> +          str++;
>>           }
>>         else
>>           return -1;
>>
> 
> LGTM.
> 

Agreed, without str++ the subsequent str[1] == '\0' is false and
you return -1.

OK for 2.32.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tulio Magno Quites Machado Filho July 21, 2020, 9:04 p.m. UTC | #3
Carlos O'Donell via Libc-alpha <libc-alpha@sourceware.org> writes:

> OK for 2.32.
>
> Reviewed-by: Carlos O'Donell <carlos@redhat.com>

Pushed as f6add169c89bbdd139a2eb845686127ead5799cd.

Thanks!
diff mbox series

Patch

diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index 497dc568e9..f07500619a 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -96,6 +96,7 @@  _dl_string_platform (const char *str)
 	  if (str[1] == '0')
 	    {
 	      ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER10;
+	      str++;
 	    }
 	  else
 	    return -1;