On Thu, Jan 17, 2008 at 11:47:50PM +0800, Bean wrote: > > Embedded function used %ecx to store the pointer to it's parent's > stack. However, the program is compiled using option -mregparm=3, > which means it can use up to 3 registry to pass parameter.In > grub_elf32_load_segment, there are three parameter elf, phdr and hook, > which will take up %eax, %edx and %ecx. The value of %ecx, hook, will > be overwritten. Use NESTED_FUNC_ATTR ensure that only the first two > parameter will be passed using registry > > This problem can occur when the following conditions are true: > > 1, Use embedded function as callback. > 2, The embedded function use local variable in it's parent's stack. > 3, The embedded function has at least three parameters.
Thanks for the explanation, I think I got the idea now. I reviewed all GRUB code for other instances of this bug, and only found the equivalent 64-bit versions of the functions you fixed to be affected. Just committed a fix based on your patch (plus the 64-bit ones). -- Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call… if you are unable to speak? (as seen on /.) _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel