Author: wmb Date: Mon Jun 13 11:51:27 2011 New Revision: 2267 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2267
Log: OLPC XO-1.75 trac #10892 - fixed crash re-executing cifs-connect - caused by memory tests overwriting the crypto code.
Modified: cpu/arm/linux.fth cpu/arm/olpc/1.75/fw.bth cpu/x86/pc/olpc/crypto.fth
Modified: cpu/arm/linux.fth ============================================================================== --- cpu/arm/linux.fth Mon Jun 13 06:41:52 2011 (r2266) +++ cpu/arm/linux.fth Mon Jun 13 11:51:27 2011 (r2267) @@ -14,17 +14,21 @@ \ If we have already loaded a RAMdisk in high memory, its base is the memory limit ramdisk-adr ?dup if exit then
- " /memory" find-package 0= abort" No /memory node" ( phandle ) - " available" rot get-package-property abort" No memory node available property" ( $ ) - \ Find the memory piece that starts at 0 - begin dup 8 >= while ( $ ) - decode-int h# 1000 u<= if ( $ ) \ Found the one we want - decode-int ( $ limit ) - nip nip exit - then ( $ ) - decode-int drop ( $ ) - repeat ( $ ) - 2drop true abort" No suitable memory piece" + 0 0 ( size base ) + " /memory" find-package 0= abort" No /memory node" ( size base phandle ) + " available" rot get-package-property abort" No memory node available property" ( limit size $ ) + \ Find the largest memory piece + begin dup 8 >= while ( size base $ ) + 2 decode-ints ( size base $ size1 base1 ) + 5 pick 2 pick <= if ( size base $ size1 base1 ) + 2>r 2nip 2r> ( $ size1 base1 ) + 2swap ( size' base' $ ) + else ( size base $ size1 base1 ) + 2drop ( size base $ ) + then ( size base $ ) + repeat ( size base $ ) + 2drop ( size base ) + + ( limit ) ;
: add-root-dev ( cmdline$ -- cmdline$' )
Modified: cpu/arm/olpc/1.75/fw.bth ============================================================================== --- cpu/arm/olpc/1.75/fw.bth Mon Jun 13 06:41:52 2011 (r2266) +++ cpu/arm/olpc/1.75/fw.bth Mon Jun 13 11:51:27 2011 (r2267) @@ -26,6 +26,7 @@
: usb-quiet ( -- ) [ ' linux-hook behavior compile, ] \ Chain to old behavior + unload-crypto " /usb" " reset-usb" execute-device-method drop ;
Modified: cpu/x86/pc/olpc/crypto.fth ============================================================================== --- cpu/x86/pc/olpc/crypto.fth Mon Jun 13 06:41:52 2011 (r2266) +++ cpu/x86/pc/olpc/crypto.fth Mon Jun 13 11:51:27 2011 (r2267) @@ -5,6 +5,7 @@ h# d0000 constant verify-bss \ The address the code is linked to run at h# 10000 constant /verify-bss h# 9c000 constant verify-stack +0 value /verify
0 value crypto-loaded? : load-crypto ( -- error? ) @@ -12,10 +13,17 @@ " verify" find-drop-in 0= if ." Can't find crypto code" cr true exit then ( prog$ ) - 2dup verify-base swap move free-mem ( ) + dup to /verify ( prog$ ) + verify-base /verify 0 mem-claim drop ( prog$ ) + 2dup verify-base swap move free-mem ( ) true to crypto-loaded? false ; +: unload-crypto ( -- ) + crypto-loaded? 0= if exit then + verify-base /verify mem-release + false to crypto-loaded? +;
: signature-bad? ( data$ sig$ key$ hashname$ -- mismatch? ) $cstr
openfirmware@openfirmware.info