Summary: | sys-boot/grub-0.97 fails to report memory limits correctly with >=sys-devel/gcc-4.1 SSP | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Anthony Basile <blueness> |
Component: | Hardened | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hardened |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | done:0.97-r10 | ||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 318171 | ||
Attachments: |
Turn off ssp in libgrub_a_CFLAGS
Turn off ssp in libgrub_a_CFLAGS New ebuild to apply the fix ssp patch |
Description
Anthony Basile
![]() Breakpoint 1, grub_printf (format=0xf7ff8668 "\n GNU GRUB version %s (%dK lower / %dK upper memory)\n\n") at char_io.c:200 200 *convert_to_ascii (str, c, va_arg(ap, unsigned long)) = 0; (gdb) print mbi.mem_upper $1 = 7168 (gdb) print mbi.mem_lower $2 = 640 But when it print the value of mbi.mem_lower and mbi.mem_upper it get garbage. Okay a completely different approach is needed. Rather than fix up grub_printf and regress back, we can just turn off ssp on libgrub_a-*.o by adding -fno-stack-protector to the libgrub_a_CFLAGS, and still build the grub utility with ssp. You do not need to apply the patch from Bug 279536 to fix the variadic parameters, only the patch below. Created attachment 220249 [details, diff] Turn off ssp in libgrub_a_CFLAGS This patch must be applied after all the other patches are applied or else it will fail. grub-0.97-r9.ebuild should be rewritten so that src_unpack patches something like this ... if [[ -n ${PATCHVER} ]] ; then EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch fi #bug 279536 epatch "${FILESDIR}"/fix-ssp.patch eautoreconf so we're clear, libgrub.a is used entirely by the stage1/stage2 code as well as the Linux `grub` program ? Yes, a quick read of grub/Makefile shows that grub is linked against libgrub.a. I've also written the ebuild and renamed the patch more appropriately. They are on the hardened-dev overlay for testing. I'll attach them here too. Created attachment 222477 [details, diff]
Turn off ssp in libgrub_a_CFLAGS
Created attachment 222479 [details]
New ebuild to apply the fix ssp patch
The patch needs to be applied after the other patches but before eautoreconf. I'd recommend bundling it with the other patches in grub-0.97-patches-1.9.tar.bz
just reopening until such time as I spin the next grub patchset and ebuild. When will the grub patchset be bumed? For the >=GCC 4.4.3 with SSP support will be commited to the tree this weekend. i dont bump 0.9x versions ... being leaving that to Robin Now committed and published as new patchset: grub-0.97-patches-1.10.tar.bz2 Ebuild sys-boot/grub-0.97-r10 committed. |