[PATCH] x86/CET: Don't parse beyond the note end

Florian Weimer fweimer@redhat.com
Fri Jul 27 18:26:00 GMT 2018


On 07/27/2018 08:22 PM, H.J. Lu wrote:
> -	  while (1)
> +	  while (ptr < ptr_end)
>   	    {
>   	      unsigned int type = *(unsigned int *) ptr;
>   	      unsigned int datasz = *(unsigned int *) (ptr + 4);

You need 1 byte, but 8 bytes.  Why is checking for at least 1 byte 
sufficient here?

I suppose our position is that we do not care about corrupt binaries. 
Is that justification for writing the check this way?

Thanks,
Florian



More information about the Libc-alpha mailing list