Re: [PATCH] x86: pad assembly functions with INT3

2018-05-15 Thread hpa
On May 14, 2018 11:54:05 PM PDT, Ingo Molnar wrote: > >* h...@zytor.com wrote: > >> > I guess it won't try to speculatively execute the 'pad' >instructions - but you >> > can never really tell! >> > >> >David >> >> The CPU doesn't speculate down past an unconditional control >transfer. Doin

Re: [PATCH] x86: pad assembly functions with INT3

2018-05-14 Thread Ingo Molnar
* h...@zytor.com wrote: > > I guess it won't try to speculatively execute the 'pad' instructions - but > > you > > can never really tell! > > > > David > > The CPU doesn't speculate down past an unconditional control transfer. Doing > so > would be idiotic. I think, when it comes to sp

RE: [PATCH] x86: pad assembly functions with INT3

2018-05-14 Thread hpa
On May 14, 2018 2:04:38 AM PDT, David Laight wrote: >From: H. Peter Anvin >> Sent: 11 May 2018 19:54 >> >> On 05/10/18 09:39, David Laight wrote: >> > From: Alexey Dobriyan >> >> Sent: 07 May 2018 22:38 >> >> >> >> Use INT3 instead of NOP. All that padding between functions is >> >> an illegal ar

RE: [PATCH] x86: pad assembly functions with INT3

2018-05-14 Thread David Laight
From: H. Peter Anvin > Sent: 11 May 2018 19:54 > > On 05/10/18 09:39, David Laight wrote: > > From: Alexey Dobriyan > >> Sent: 07 May 2018 22:38 > >> > >> Use INT3 instead of NOP. All that padding between functions is > >> an illegal area, no legitimate code should jump into it. > >> > >> I've che

Re: [PATCH] x86: pad assembly functions with INT3

2018-05-11 Thread H. Peter Anvin
On 05/10/18 09:39, David Laight wrote: > From: Alexey Dobriyan >> Sent: 07 May 2018 22:38 >> >> Use INT3 instead of NOP. All that padding between functions is >> an illegal area, no legitimate code should jump into it. >> >> I've checked x86_64 allyesconfig disassembly, all changes looks sane: >> I

RE: [PATCH] x86: pad assembly functions with INT3

2018-05-10 Thread David Laight
From: Alexey Dobriyan > Sent: 07 May 2018 22:38 > > Use INT3 instead of NOP. All that padding between functions is > an illegal area, no legitimate code should jump into it. > > I've checked x86_64 allyesconfig disassembly, all changes looks sane: > INT3 is only used after RET or unconditional JM

Re: [PATCH] x86: pad assembly functions with INT3

2018-05-09 Thread H. Peter Anvin
On 05/09/18 09:55, Alexey Dobriyan wrote: > On Mon, May 07, 2018 at 02:41:14PM -0700, h...@zytor.com wrote: >>> -#define __ALIGN.p2align 4, 0x90 >>> +#define __ALIGN.p2align 4, 0xCC >> >> Acked-by: H. Peter Anvin > > Thanks! > > If someone knows how to control _compiler_

Re: [PATCH] x86: pad assembly functions with INT3

2018-05-09 Thread Alexey Dobriyan
On Mon, May 07, 2018 at 02:41:14PM -0700, h...@zytor.com wrote: > >-#define __ALIGN .p2align 4, 0x90 > >+#define __ALIGN .p2align 4, 0xCC > > Acked-by: H. Peter Anvin Thanks! If someone knows how to control _compiler_ inter-function padding, please tell.

Re: [PATCH] x86: pad assembly functions with INT3

2018-05-07 Thread hpa
On May 7, 2018 2:37:55 PM PDT, Alexey Dobriyan wrote: >Use INT3 instead of NOP. All that padding between functions is >an illegal area, no legitimate code should jump into it. > >I've checked x86_64 allyesconfig disassembly, all changes looks sane: >INT3 is only used after RET or unconditional JMP

[PATCH] x86: pad assembly functions with INT3

2018-05-07 Thread Alexey Dobriyan
Use INT3 instead of NOP. All that padding between functions is an illegal area, no legitimate code should jump into it. I've checked x86_64 allyesconfig disassembly, all changes looks sane: INT3 is only used after RET or unconditional JMP. Signed-off-by: Alexey Dobriyan --- arch/x86/include/as