[OpenBIOS] [PATCH 2/2] Don't map the page 0 to make NULL-dereferencing more obvious

Segher Boessenkool segher at kernel.crashing.org
Thu Apr 11 03:19:45 CEST 2013


> Hmmm the source looks like this:
>
> " /chosen" find-dev if
>   " mmu" rot get-package-property 0= if
>     decode-int nip nip ihandle>phandle active-package = if
>     ...
>     then
>   then
> then
>
> AFAICT the code should get the chosen package "mmu" property,  
> decode it, remove the remainder, convert to a phandle and then do  
> the comparison to active-package which should be valid?

... and 0 is never a valid ihandle; this isn't explicitly stated
in the 1275 spec as far as I know, but there are many words that
return ( ihandle | 0 ) , so for that to work, 0 cannot be a valid
ihandle (many implementations use pointers as ihandles, but not
all).


Segher




More information about the OpenBIOS mailing list