Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-18 Thread Ingo Molnar
* Ingo Molnar wrote: > 2) code robustness > > For example: > > for (i = 0; i < 10; i++) > if (foo) > bar(i); > baz(i); > > Is probably buggy code, although technically it's valid syntax and will > compile >

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-18 Thread Ingo Molnar
* Ingo Molnar wrote: > 2) code robustness > > For example: > > for (i = 0; i < 10; i++) > if (foo) > bar(i); > baz(i); > > Is probably buggy code, although technically it's valid syntax and will > compile > just fine. > > If

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-18 Thread Ingo Molnar
* Thomas Gleixner wrote: > On Sat, 17 Feb 2018, Josh Poimboeuf wrote: > > On Sat, Feb 17, 2018 at 11:38:48AM +0100, Ingo Molnar wrote: > > > > > > * Josh Poimboeuf wrote: > > > > > > > +/* Disable any jump label entries in __init code */ > > > > +void

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-18 Thread Ingo Molnar
* Thomas Gleixner wrote: > On Sat, 17 Feb 2018, Josh Poimboeuf wrote: > > On Sat, Feb 17, 2018 at 11:38:48AM +0100, Ingo Molnar wrote: > > > > > > * Josh Poimboeuf wrote: > > > > > > > +/* Disable any jump label entries in __init code */ > > > > +void __init jump_label_invalidate_init(void)

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-17 Thread Thomas Gleixner
On Sat, 17 Feb 2018, Josh Poimboeuf wrote: > On Sat, Feb 17, 2018 at 11:38:48AM +0100, Ingo Molnar wrote: > > > > * Josh Poimboeuf wrote: > > > > > +/* Disable any jump label entries in __init code */ > > > +void __init jump_label_invalidate_init(void) > > > +{ > > > +

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-17 Thread Thomas Gleixner
On Sat, 17 Feb 2018, Josh Poimboeuf wrote: > On Sat, Feb 17, 2018 at 11:38:48AM +0100, Ingo Molnar wrote: > > > > * Josh Poimboeuf wrote: > > > > > +/* Disable any jump label entries in __init code */ > > > +void __init jump_label_invalidate_init(void) > > > +{ > > > + struct jump_entry

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-17 Thread Josh Poimboeuf
On Sat, Feb 17, 2018 at 11:38:48AM +0100, Ingo Molnar wrote: > > * Josh Poimboeuf wrote: > > > +/* Disable any jump label entries in __init code */ > > +void __init jump_label_invalidate_init(void) > > +{ > > + struct jump_entry *iter_start = __start___jump_table; > > +

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-17 Thread Josh Poimboeuf
On Sat, Feb 17, 2018 at 11:38:48AM +0100, Ingo Molnar wrote: > > * Josh Poimboeuf wrote: > > > +/* Disable any jump label entries in __init code */ > > +void __init jump_label_invalidate_init(void) > > +{ > > + struct jump_entry *iter_start = __start___jump_table; > > + struct jump_entry

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-17 Thread Ingo Molnar
* Josh Poimboeuf wrote: > +/* Disable any jump label entries in __init code */ > +void __init jump_label_invalidate_init(void) > +{ > + struct jump_entry *iter_start = __start___jump_table; > + struct jump_entry *iter_stop = __stop___jump_table; > + struct

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-17 Thread Ingo Molnar
* Josh Poimboeuf wrote: > +/* Disable any jump label entries in __init code */ > +void __init jump_label_invalidate_init(void) > +{ > + struct jump_entry *iter_start = __start___jump_table; > + struct jump_entry *iter_stop = __stop___jump_table; > + struct jump_entry *iter; > + > +

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-16 Thread Jason Baron
On 02/16/2018 11:31 AM, Josh Poimboeuf wrote: > After initmem has been freed, any jump label entries in __init code are > prevented from being written to by the kernel_text_address() check in > __jump_label_update(). However, this check is quite broad. If > kernel_text_address() were to return

Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-16 Thread Jason Baron
On 02/16/2018 11:31 AM, Josh Poimboeuf wrote: > After initmem has been freed, any jump label entries in __init code are > prevented from being written to by the kernel_text_address() check in > __jump_label_update(). However, this check is quite broad. If > kernel_text_address() were to return

[PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-16 Thread Josh Poimboeuf
After initmem has been freed, any jump label entries in __init code are prevented from being written to by the kernel_text_address() check in __jump_label_update(). However, this check is quite broad. If kernel_text_address() were to return false for any other reason, the jump label write would

[PATCH v2 1/2] jump_label: Explicitly disable jump labels in __init code

2018-02-16 Thread Josh Poimboeuf
After initmem has been freed, any jump label entries in __init code are prevented from being written to by the kernel_text_address() check in __jump_label_update(). However, this check is quite broad. If kernel_text_address() were to return false for any other reason, the jump label write would