|
|
Log in / Subscribe / Register

Meltdown and Spectre mitigations — a February update

Meltdown and Spectre mitigations — a February update

Posted Feb 6, 2018 1:38 UTC (Tue) by roc (subscriber, #30627)
Parent article: Meltdown and Spectre mitigations — a February update

Has anyone discussed how array_index_nospec behaves when the array is empty? Seems to me that it allows speculation based on what would be at the first element of the array.

I guess in common cases the array is either statically known to be non-empty or the data pointer for an empty array would be null, but it may be a potential footgun. I can't find any discussion of this.


to post comments

Meltdown and Spectre mitigations — a February update

Posted Feb 6, 2018 4:02 UTC (Tue) by willy (subscriber, #9762) [Link]

If you kmalloc 0 bytes, you get a special ZERO pointer back, different from NULL, but still in the unmapped first 4k page.
I suppose there might be a danger if you have struct { int count; void *entries[]; } and kmalloc four bytes to store the int ...


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds