Re: [x86] copy_from{to}_user question

2015-08-24 Thread Jeff Epler
On Mon, Aug 24, 2015 at 03:52:11PM +0800, yalin wang wrote: > i am not clear about what is STAC / SMAP ? > could you give me a link for understanding ? the first item I found by googling was https://lwn.net/Articles/517251/ Jeff -- To unsubscribe from this list: send the line "unsubscribe linux-k

Re: [x86] copy_from{to}_user question

2015-08-24 Thread yalin wang
> On Aug 22, 2015, at 17:05, Borislav Petkov wrote: > > On Fri, Aug 21, 2015 at 02:06:16PM -0700, H. Peter Anvin wrote: >> What I'm saying is that we do do STAC, which *disables* SMAP. We have >> to do that because one pointer is known to be a user space pointer. >> >> However, we currently do

Re: [x86] copy_from{to}_user question

2015-08-22 Thread Borislav Petkov
On Fri, Aug 21, 2015 at 02:06:16PM -0700, H. Peter Anvin wrote: > What I'm saying is that we do do STAC, which *disables* SMAP. We have > to do that because one pointer is known to be a user space pointer. > > However, we currently don't verify that the *other* pointer is kernel > space, which it

Re: [x86] copy_from{to}_user question

2015-08-21 Thread H. Peter Anvin
On 08/20/2015 09:35 PM, Borislav Petkov wrote: > On Thu, Aug 20, 2015 at 11:22:43AM -0700, H. Peter Anvin wrote: >> There is a valid reason to do this, which is that currently >> copy_{to,from}_user() effectively bypass SMAP as they don't verify that >> the kernel pointer is actually a kernel point

Re: [x86] copy_from{to}_user question

2015-08-20 Thread Borislav Petkov
On Thu, Aug 20, 2015 at 11:22:43AM -0700, H. Peter Anvin wrote: > There is a valid reason to do this, which is that currently > copy_{to,from}_user() effectively bypass SMAP as they don't verify that > the kernel pointer is actually a kernel pointer. Well, we do STAC before we copy but SMAP is che

Re: [x86] copy_from{to}_user question

2015-08-20 Thread H. Peter Anvin
On 08/16/2015 09:16 PM, Borislav Petkov wrote: > On Mon, Aug 17, 2015 at 11:27:01AM +0800, yalin wang wrote: >> i just want the x86 copy_from{to,in}_user() function have >> the same behaviour as other platforms. > > Back to the original question from 2 mails ago: > > How else would we be able to

Re: [x86] copy_from{to}_user question

2015-08-20 Thread yalin wang
> On Aug 17, 2015, at 12:16, Borislav Petkov wrote: > > On Mon, Aug 17, 2015 at 11:27:01AM +0800, yalin wang wrote: >> i just want the x86 copy_from{to,in}_user() function have >> the same behaviour as other platforms. > > Back to the original question from 2 mails ago: > > How else would we

Re: [x86] copy_from{to}_user question

2015-08-16 Thread Borislav Petkov
On Mon, Aug 17, 2015 at 11:27:01AM +0800, yalin wang wrote: > i just want the x86 copy_from{to,in}_user() function have > the same behaviour as other platforms. Back to the original question from 2 mails ago: How else would we be able to use the same function in copy_to and copy_from variants?

Re: [x86] copy_from{to}_user question

2015-08-16 Thread yalin wang
> On Aug 14, 2015, at 00:43, Borislav Petkov wrote: > > On Thu, Aug 13, 2015 at 06:04:54PM +0800, yalin wang wrote: >> we store type into one fix register, for example r12 , >> then in fix up code, we can know the exception is caused by copy_from >> copy_to or copy_in user function by check r12

Re: [x86] copy_from{to}_user question

2015-08-13 Thread Borislav Petkov
On Thu, Aug 13, 2015 at 06:04:54PM +0800, yalin wang wrote: > we store type into one fix register, for example r12 , > then in fix up code, we can know the exception is caused by copy_from > copy_to or copy_in user function by check r12 value(0 , 1 ,2 value), then if > it is copy_from, we only all

Re: [x86] copy_from{to}_user question

2015-08-13 Thread yalin wang
> On Aug 12, 2015, at 18:07, Borislav Petkov wrote: > > On Wed, Aug 12, 2015 at 05:01:14PM +0800, yalin wang wrote: >> hi x86 maintainers, >> >> i have a question about copy_from{to}_user() function, >> i find on other platforms like arm/ arm64 /hexagon, >> all copy_from{to}_user function only

Re: [x86] copy_from{to}_user question

2015-08-12 Thread Borislav Petkov
On Wed, Aug 12, 2015 at 05:01:14PM +0800, yalin wang wrote: > hi x86 maintainers, > > i have a question about copy_from{to}_user() function, > i find on other platforms like arm/ arm64 /hexagon, > all copy_from{to}_user function only check source address for > copy_from and only check to address f