Re: [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
Ok, interrupt.h sounds good. On Fri, Jan 29, 2016 at 3:45 PM, Steven Rostedtwrote: > On Fri, 29 Jan 2016 12:59:13 +0100 > Alexander Potapenko wrote: > >> On the other hand, this will require including into >> various files that currently use __irq_section. >> But that header has a comment saying: >> >> /* >> * Please do not include this file in generic code. There is currently >> * no requirement for any architecture to implement anything held >> * within this file. >> * >> * Thanks. --rmk >> */ >> >> Do we really want to put anything into that header? >> > > What about interrupt.h? > > It's just weird to have KSAN needing to pull in ftrace.h for irq work. > > -- Steve -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
Re: [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
Ok, interrupt.h sounds good. On Fri, Jan 29, 2016 at 3:45 PM, Steven Rostedt wrote: > On Fri, 29 Jan 2016 12:59:13 +0100 > Alexander Potapenko wrote: > >> On the other hand, this will require including into >> various files that currently use __irq_section. >> But that header has a comment saying: >> >> /* >> * Please do not include this file in generic code. There is currently >> * no requirement for any architecture to implement anything held >> * within this file. >> * >> * Thanks. --rmk >> */ >> >> Do we really want to put anything into that header? >> > > What about interrupt.h? > > It's just weird to have KSAN needing to pull in ftrace.h for irq work. > > -- Steve -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
Re: [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
On Fri, 29 Jan 2016 12:59:13 +0100 Alexander Potapenko wrote: > On the other hand, this will require including into > various files that currently use __irq_section. > But that header has a comment saying: > > /* > * Please do not include this file in generic code. There is currently > * no requirement for any architecture to implement anything held > * within this file. > * > * Thanks. --rmk > */ > > Do we really want to put anything into that header? > What about interrupt.h? It's just weird to have KSAN needing to pull in ftrace.h for irq work. -- Steve
Re: [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
On the other hand, this will require including into various files that currently use __irq_section. But that header has a comment saying: /* * Please do not include this file in generic code. There is currently * no requirement for any architecture to implement anything held * within this file. * * Thanks. --rmk */ Do we really want to put anything into that header? On Fri, Jan 29, 2016 at 12:33 PM, Alexander Potapenko wrote: > Agreed. Once I receive more comments I will make a new patch set and > include this change as well. > > On Thu, Jan 28, 2016 at 3:53 PM, Steven Rostedt wrote: >> On Wed, 27 Jan 2016 19:25:09 +0100 >> Alexander Potapenko wrote: >> >>> --- a/include/linux/ftrace.h >>> +++ b/include/linux/ftrace.h >>> @@ -762,6 +762,26 @@ struct ftrace_graph_ret { >>> typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* >>> return */ >>> typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry >>> */ >>> >>> +#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN) >>> +/* >>> + * We want to know which function is an entrypoint of a hardirq. >>> + */ >>> +#define __irq_entry >>> __attribute__((__section__(".irqentry.text"))) >>> +#define __softirq_entry \ >>> + __attribute__((__section__(".softirqentry.text"))) >>> + >>> +/* Limits of hardirq entrypoints */ >>> +extern char __irqentry_text_start[]; >>> +extern char __irqentry_text_end[]; >>> +/* Limits of softirq entrypoints */ >>> +extern char __softirqentry_text_start[]; >>> +extern char __softirqentry_text_end[]; >>> + >>> +#else >>> +#define __irq_entry >>> +#define __softirq_entry >>> +#endif >>> + >>> #ifdef CONFIG_FUNCTION_GRAPH_TRACER >>> >>> /* for init task */ >> >> Since this is no longer just used for function tracing, perhaps the >> code should be moved to include/linux/irq.h or something. >> >> -- Steve >> > > > > -- > Alexander Potapenko > Software Engineer > > Google Germany GmbH > Erika-Mann-Straße, 33 > 80636 München > > Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle > Registergericht und -nummer: Hamburg, HRB 86891 > Sitz der Gesellschaft: Hamburg > Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, > leiten Sie diese bitte nicht weiter, informieren Sie den > Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. > This e-mail is confidential. If you are not the right addressee please > do not forward it, please inform the sender, and please erase this > e-mail including any attachments. Thanks. -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
Re: [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
Agreed. Once I receive more comments I will make a new patch set and include this change as well. On Thu, Jan 28, 2016 at 3:53 PM, Steven Rostedt wrote: > On Wed, 27 Jan 2016 19:25:09 +0100 > Alexander Potapenko wrote: > >> --- a/include/linux/ftrace.h >> +++ b/include/linux/ftrace.h >> @@ -762,6 +762,26 @@ struct ftrace_graph_ret { >> typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* >> return */ >> typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry >> */ >> >> +#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN) >> +/* >> + * We want to know which function is an entrypoint of a hardirq. >> + */ >> +#define __irq_entry __attribute__((__section__(".irqentry.text"))) >> +#define __softirq_entry \ >> + __attribute__((__section__(".softirqentry.text"))) >> + >> +/* Limits of hardirq entrypoints */ >> +extern char __irqentry_text_start[]; >> +extern char __irqentry_text_end[]; >> +/* Limits of softirq entrypoints */ >> +extern char __softirqentry_text_start[]; >> +extern char __softirqentry_text_end[]; >> + >> +#else >> +#define __irq_entry >> +#define __softirq_entry >> +#endif >> + >> #ifdef CONFIG_FUNCTION_GRAPH_TRACER >> >> /* for init task */ > > Since this is no longer just used for function tracing, perhaps the > code should be moved to include/linux/irq.h or something. > > -- Steve > -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
Re: [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
On Fri, 29 Jan 2016 12:59:13 +0100 Alexander Potapenkowrote: > On the other hand, this will require including into > various files that currently use __irq_section. > But that header has a comment saying: > > /* > * Please do not include this file in generic code. There is currently > * no requirement for any architecture to implement anything held > * within this file. > * > * Thanks. --rmk > */ > > Do we really want to put anything into that header? > What about interrupt.h? It's just weird to have KSAN needing to pull in ftrace.h for irq work. -- Steve
Re: [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
Agreed. Once I receive more comments I will make a new patch set and include this change as well. On Thu, Jan 28, 2016 at 3:53 PM, Steven Rostedtwrote: > On Wed, 27 Jan 2016 19:25:09 +0100 > Alexander Potapenko wrote: > >> --- a/include/linux/ftrace.h >> +++ b/include/linux/ftrace.h >> @@ -762,6 +762,26 @@ struct ftrace_graph_ret { >> typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* >> return */ >> typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry >> */ >> >> +#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN) >> +/* >> + * We want to know which function is an entrypoint of a hardirq. >> + */ >> +#define __irq_entry __attribute__((__section__(".irqentry.text"))) >> +#define __softirq_entry \ >> + __attribute__((__section__(".softirqentry.text"))) >> + >> +/* Limits of hardirq entrypoints */ >> +extern char __irqentry_text_start[]; >> +extern char __irqentry_text_end[]; >> +/* Limits of softirq entrypoints */ >> +extern char __softirqentry_text_start[]; >> +extern char __softirqentry_text_end[]; >> + >> +#else >> +#define __irq_entry >> +#define __softirq_entry >> +#endif >> + >> #ifdef CONFIG_FUNCTION_GRAPH_TRACER >> >> /* for init task */ > > Since this is no longer just used for function tracing, perhaps the > code should be moved to include/linux/irq.h or something. > > -- Steve > -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
Re: [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
On the other hand, this will require including into various files that currently use __irq_section. But that header has a comment saying: /* * Please do not include this file in generic code. There is currently * no requirement for any architecture to implement anything held * within this file. * * Thanks. --rmk */ Do we really want to put anything into that header? On Fri, Jan 29, 2016 at 12:33 PM, Alexander Potapenkowrote: > Agreed. Once I receive more comments I will make a new patch set and > include this change as well. > > On Thu, Jan 28, 2016 at 3:53 PM, Steven Rostedt wrote: >> On Wed, 27 Jan 2016 19:25:09 +0100 >> Alexander Potapenko wrote: >> >>> --- a/include/linux/ftrace.h >>> +++ b/include/linux/ftrace.h >>> @@ -762,6 +762,26 @@ struct ftrace_graph_ret { >>> typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* >>> return */ >>> typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry >>> */ >>> >>> +#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN) >>> +/* >>> + * We want to know which function is an entrypoint of a hardirq. >>> + */ >>> +#define __irq_entry >>> __attribute__((__section__(".irqentry.text"))) >>> +#define __softirq_entry \ >>> + __attribute__((__section__(".softirqentry.text"))) >>> + >>> +/* Limits of hardirq entrypoints */ >>> +extern char __irqentry_text_start[]; >>> +extern char __irqentry_text_end[]; >>> +/* Limits of softirq entrypoints */ >>> +extern char __softirqentry_text_start[]; >>> +extern char __softirqentry_text_end[]; >>> + >>> +#else >>> +#define __irq_entry >>> +#define __softirq_entry >>> +#endif >>> + >>> #ifdef CONFIG_FUNCTION_GRAPH_TRACER >>> >>> /* for init task */ >> >> Since this is no longer just used for function tracing, perhaps the >> code should be moved to include/linux/irq.h or something. >> >> -- Steve >> > > > > -- > Alexander Potapenko > Software Engineer > > Google Germany GmbH > Erika-Mann-Straße, 33 > 80636 München > > Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle > Registergericht und -nummer: Hamburg, HRB 86891 > Sitz der Gesellschaft: Hamburg > Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, > leiten Sie diese bitte nicht weiter, informieren Sie den > Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. > This e-mail is confidential. If you are not the right addressee please > do not forward it, please inform the sender, and please erase this > e-mail including any attachments. Thanks. -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
Re: [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
On Wed, 27 Jan 2016 19:25:09 +0100 Alexander Potapenko wrote: > --- a/include/linux/ftrace.h > +++ b/include/linux/ftrace.h > @@ -762,6 +762,26 @@ struct ftrace_graph_ret { > typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return > */ > typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */ > > +#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN) > +/* > + * We want to know which function is an entrypoint of a hardirq. > + */ > +#define __irq_entry __attribute__((__section__(".irqentry.text"))) > +#define __softirq_entry \ > + __attribute__((__section__(".softirqentry.text"))) > + > +/* Limits of hardirq entrypoints */ > +extern char __irqentry_text_start[]; > +extern char __irqentry_text_end[]; > +/* Limits of softirq entrypoints */ > +extern char __softirqentry_text_start[]; > +extern char __softirqentry_text_end[]; > + > +#else > +#define __irq_entry > +#define __softirq_entry > +#endif > + > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > > /* for init task */ Since this is no longer just used for function tracing, perhaps the code should be moved to include/linux/irq.h or something. -- Steve
Re: [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
On Wed, 27 Jan 2016 19:25:09 +0100 Alexander Potapenkowrote: > --- a/include/linux/ftrace.h > +++ b/include/linux/ftrace.h > @@ -762,6 +762,26 @@ struct ftrace_graph_ret { > typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return > */ > typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */ > > +#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN) > +/* > + * We want to know which function is an entrypoint of a hardirq. > + */ > +#define __irq_entry __attribute__((__section__(".irqentry.text"))) > +#define __softirq_entry \ > + __attribute__((__section__(".softirqentry.text"))) > + > +/* Limits of hardirq entrypoints */ > +extern char __irqentry_text_start[]; > +extern char __irqentry_text_end[]; > +/* Limits of softirq entrypoints */ > +extern char __softirqentry_text_start[]; > +extern char __softirqentry_text_end[]; > + > +#else > +#define __irq_entry > +#define __softirq_entry > +#endif > + > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > > /* for init task */ Since this is no longer just used for function tracing, perhaps the code should be moved to include/linux/irq.h or something. -- Steve
[PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
KASAN needs to know whether the allocation happens in an IRQ handler. This lets us strip everything below the IRQ entry point to reduce the number of unique stack traces needed to be stored. Signed-off-by: Alexander Potapenko --- arch/arm/kernel/vmlinux.lds.S| 1 + arch/arm64/kernel/vmlinux.lds.S | 1 + arch/blackfin/kernel/vmlinux.lds.S | 1 + arch/c6x/kernel/vmlinux.lds.S| 1 + arch/metag/kernel/vmlinux.lds.S | 1 + arch/microblaze/kernel/vmlinux.lds.S | 1 + arch/mips/kernel/vmlinux.lds.S | 1 + arch/nios2/kernel/vmlinux.lds.S | 1 + arch/openrisc/kernel/vmlinux.lds.S | 1 + arch/parisc/kernel/vmlinux.lds.S | 1 + arch/powerpc/kernel/vmlinux.lds.S| 1 + arch/s390/kernel/vmlinux.lds.S | 1 + arch/sh/kernel/vmlinux.lds.S | 1 + arch/sparc/kernel/vmlinux.lds.S | 1 + arch/tile/kernel/vmlinux.lds.S | 1 + arch/x86/kernel/vmlinux.lds.S| 1 + include/asm-generic/vmlinux.lds.h| 12 +++- include/linux/ftrace.h | 31 --- kernel/softirq.c | 3 ++- 19 files changed, 49 insertions(+), 13 deletions(-) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 8b60fde..28b690fc 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -105,6 +105,7 @@ SECTIONS *(.exception.text) __exception_text_end = .; IRQENTRY_TEXT + SOFTIRQENTRY_TEXT TEXT_TEXT SCHED_TEXT LOCK_TEXT diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index e3928f5..b9242b7 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -102,6 +102,7 @@ SECTIONS *(.exception.text) __exception_text_end = .; IRQENTRY_TEXT + SOFTIRQENTRY_TEXT TEXT_TEXT SCHED_TEXT LOCK_TEXT diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index c9eec84..d920b95 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S @@ -35,6 +35,7 @@ SECTIONS #endif LOCK_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT KPROBES_TEXT #ifdef CONFIG_ROMKERNEL __sinittext = .; diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel/vmlinux.lds.S index 5a6e141..50bc10f 100644 --- a/arch/c6x/kernel/vmlinux.lds.S +++ b/arch/c6x/kernel/vmlinux.lds.S @@ -72,6 +72,7 @@ SECTIONS SCHED_TEXT LOCK_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT KPROBES_TEXT *(.fixup) *(.gnu.warning) diff --git a/arch/metag/kernel/vmlinux.lds.S b/arch/metag/kernel/vmlinux.lds.S index e12055e..150ace9 100644 --- a/arch/metag/kernel/vmlinux.lds.S +++ b/arch/metag/kernel/vmlinux.lds.S @@ -24,6 +24,7 @@ SECTIONS LOCK_TEXT KPROBES_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT *(.text.*) *(.gnu.warning) } diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S index be9488d..0a47f04 100644 --- a/arch/microblaze/kernel/vmlinux.lds.S +++ b/arch/microblaze/kernel/vmlinux.lds.S @@ -36,6 +36,7 @@ SECTIONS { LOCK_TEXT KPROBES_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT . = ALIGN (4) ; _etext = . ; } diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 0a93e83..54d653e 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -58,6 +58,7 @@ SECTIONS LOCK_TEXT KPROBES_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT *(.text.*) *(.fixup) *(.gnu.warning) diff --git a/arch/nios2/kernel/vmlinux.lds.S b/arch/nios2/kernel/vmlinux.lds.S index 326fab4..e23e895 100644 --- a/arch/nios2/kernel/vmlinux.lds.S +++ b/arch/nios2/kernel/vmlinux.lds.S @@ -39,6 +39,7 @@ SECTIONS SCHED_TEXT LOCK_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT KPROBES_TEXT } =0 _etext = .; diff --git a/arch/openrisc/kernel/vmlinux.lds.S b/arch/openrisc/kernel/vmlinux.lds.S index 2d69a85..d936de4 100644 --- a/arch/openrisc/kernel/vmlinux.lds.S +++ b/arch/openrisc/kernel/vmlinux.lds.S @@ -50,6 +50,7 @@ SECTIONS LOCK_TEXT KPROBES_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT *(.fixup) *(.text.__*) _etext = .; diff --git a/arch/parisc/kernel/vmlinux.lds.S
[PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections
KASAN needs to know whether the allocation happens in an IRQ handler. This lets us strip everything below the IRQ entry point to reduce the number of unique stack traces needed to be stored. Signed-off-by: Alexander Potapenko--- arch/arm/kernel/vmlinux.lds.S| 1 + arch/arm64/kernel/vmlinux.lds.S | 1 + arch/blackfin/kernel/vmlinux.lds.S | 1 + arch/c6x/kernel/vmlinux.lds.S| 1 + arch/metag/kernel/vmlinux.lds.S | 1 + arch/microblaze/kernel/vmlinux.lds.S | 1 + arch/mips/kernel/vmlinux.lds.S | 1 + arch/nios2/kernel/vmlinux.lds.S | 1 + arch/openrisc/kernel/vmlinux.lds.S | 1 + arch/parisc/kernel/vmlinux.lds.S | 1 + arch/powerpc/kernel/vmlinux.lds.S| 1 + arch/s390/kernel/vmlinux.lds.S | 1 + arch/sh/kernel/vmlinux.lds.S | 1 + arch/sparc/kernel/vmlinux.lds.S | 1 + arch/tile/kernel/vmlinux.lds.S | 1 + arch/x86/kernel/vmlinux.lds.S| 1 + include/asm-generic/vmlinux.lds.h| 12 +++- include/linux/ftrace.h | 31 --- kernel/softirq.c | 3 ++- 19 files changed, 49 insertions(+), 13 deletions(-) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 8b60fde..28b690fc 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -105,6 +105,7 @@ SECTIONS *(.exception.text) __exception_text_end = .; IRQENTRY_TEXT + SOFTIRQENTRY_TEXT TEXT_TEXT SCHED_TEXT LOCK_TEXT diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index e3928f5..b9242b7 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -102,6 +102,7 @@ SECTIONS *(.exception.text) __exception_text_end = .; IRQENTRY_TEXT + SOFTIRQENTRY_TEXT TEXT_TEXT SCHED_TEXT LOCK_TEXT diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index c9eec84..d920b95 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S @@ -35,6 +35,7 @@ SECTIONS #endif LOCK_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT KPROBES_TEXT #ifdef CONFIG_ROMKERNEL __sinittext = .; diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel/vmlinux.lds.S index 5a6e141..50bc10f 100644 --- a/arch/c6x/kernel/vmlinux.lds.S +++ b/arch/c6x/kernel/vmlinux.lds.S @@ -72,6 +72,7 @@ SECTIONS SCHED_TEXT LOCK_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT KPROBES_TEXT *(.fixup) *(.gnu.warning) diff --git a/arch/metag/kernel/vmlinux.lds.S b/arch/metag/kernel/vmlinux.lds.S index e12055e..150ace9 100644 --- a/arch/metag/kernel/vmlinux.lds.S +++ b/arch/metag/kernel/vmlinux.lds.S @@ -24,6 +24,7 @@ SECTIONS LOCK_TEXT KPROBES_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT *(.text.*) *(.gnu.warning) } diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S index be9488d..0a47f04 100644 --- a/arch/microblaze/kernel/vmlinux.lds.S +++ b/arch/microblaze/kernel/vmlinux.lds.S @@ -36,6 +36,7 @@ SECTIONS { LOCK_TEXT KPROBES_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT . = ALIGN (4) ; _etext = . ; } diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 0a93e83..54d653e 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -58,6 +58,7 @@ SECTIONS LOCK_TEXT KPROBES_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT *(.text.*) *(.fixup) *(.gnu.warning) diff --git a/arch/nios2/kernel/vmlinux.lds.S b/arch/nios2/kernel/vmlinux.lds.S index 326fab4..e23e895 100644 --- a/arch/nios2/kernel/vmlinux.lds.S +++ b/arch/nios2/kernel/vmlinux.lds.S @@ -39,6 +39,7 @@ SECTIONS SCHED_TEXT LOCK_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT KPROBES_TEXT } =0 _etext = .; diff --git a/arch/openrisc/kernel/vmlinux.lds.S b/arch/openrisc/kernel/vmlinux.lds.S index 2d69a85..d936de4 100644 --- a/arch/openrisc/kernel/vmlinux.lds.S +++ b/arch/openrisc/kernel/vmlinux.lds.S @@ -50,6 +50,7 @@ SECTIONS LOCK_TEXT KPROBES_TEXT IRQENTRY_TEXT + SOFTIRQENTRY_TEXT *(.fixup) *(.text.__*) _etext = .; diff --git