diff mbox

[1/3] kbuild: Increase kallsyms max symbol length

Message ID 1382456783-22826-2-git-send-email-andi@firstfloor.org (mailing list archive)
State New, archived
Headers show

Commit Message

Andi Kleen Oct. 22, 2013, 3:46 p.m. UTC
From: Joe Mario <jmario@redhat.com>

[AK: This seems like a ticking time bomb even without LTO,
so should be merged now. It causes very weird problems.
Thanks to Joe for tracking them down.]

With the added postfixes that LTO adds for local
symbols, the longest name in the kernel overflows
the namebuf[KSYM_NAME_LEN] array by two bytes.  That name is:
__pci_fixup_resumePCI_VENDOR_ID_SERVERWORKSPCI_DEVICE_ID_SERVERWORKS_HT1000SBquirk_disable_broadcom_boot_interrupt.1488004.672802

Double the max symbol name length.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 include/linux/kallsyms.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joe Perches Oct. 22, 2013, 4:36 p.m. UTC | #1
On Tue, 2013-10-22 at 08:46 -0700, Andi Kleen wrote:
> From: Joe Mario <jmario@redhat.com>
> 
> [AK: This seems like a ticking time bomb even without LTO,
> so should be merged now. It causes very weird problems.
> Thanks to Joe for tracking them down.]
> 
> With the added postfixes that LTO adds for local
> symbols, the longest name in the kernel overflows
> the namebuf[KSYM_NAME_LEN] array by two bytes.  That name is:
> __pci_fixup_resumePCI_VENDOR_ID_SERVERWORKSPCI_DEVICE_ID_SERVERWORKS_HT1000SBquirk_disable_broadcom_boot_interrupt.1488004.672802
> 
> Double the max symbol name length.
[]
> diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
> index 6883e19..711a50f 100644
> --- a/include/linux/kallsyms.h
> +++ b/include/linux/kallsyms.h
> @@ -9,7 +9,7 @@
>  #include <linux/kernel.h>
>  #include <linux/stddef.h>
>  
> -#define KSYM_NAME_LEN 128
> +#define KSYM_NAME_LEN 256

Doesn't doubling seems a tad excessive given the
silly length of that symbol above?


--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andi Kleen Oct. 22, 2013, 4:40 p.m. UTC | #2
> Doesn't doubling seems a tad excessive given the
> silly length of that symbol above?

No, it doesn't.

-Andi
Joe Perches Oct. 22, 2013, 4:55 p.m. UTC | #3
On Tue, 2013-10-22 at 18:40 +0200, Andi Kleen wrote:
> > Doesn't doubling seems a tad excessive given the
> > silly length of that symbol above?
> 
> No, it doesn't.

Does it work?

Doesn't kallsyms:get_symbol_offset restrict the maximum
possible length to 255?


--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 6883e19..711a50f 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -9,7 +9,7 @@ 
 #include <linux/kernel.h>
 #include <linux/stddef.h>
 
-#define KSYM_NAME_LEN 128
+#define KSYM_NAME_LEN 256
 #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
 			 2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + 1)