Re: [PATCH RFC] usercopy: optimize stack check flow when the page-spanning test is disabled

2018-08-15 Thread Yuanxiaofeng (XiAn)
On 8/15/2018 2:54 AM, Kees Cook wrote: > (Please use contextual quoting in replies... mixing contextual with > top-posting becomes very hard to read...) > > On Tue, Aug 14, 2018 at 6:02 AM, Yuanxiaofeng (XiAn) > wrote: >> On Tue, Aug 14, 2018 at 8:35PM Matthew Wilcox wrote: >>> On Tue, Aug

Re: [PATCH RFC] usercopy: optimize stack check flow when the page-spanning test is disabled

2018-08-15 Thread Yuanxiaofeng (XiAn)
On 8/15/2018 2:54 AM, Kees Cook wrote: > (Please use contextual quoting in replies... mixing contextual with > top-posting becomes very hard to read...) > > On Tue, Aug 14, 2018 at 6:02 AM, Yuanxiaofeng (XiAn) > wrote: >> On Tue, Aug 14, 2018 at 8:35PM Matthew Wilcox wrote: >>> On Tue, Aug

Re: [PATCH RFC] usercopy: optimize stack check flow when the page-spanning test is disabled

2018-08-14 Thread Kees Cook
(Please use contextual quoting in replies... mixing contextual with top-posting becomes very hard to read...) On Tue, Aug 14, 2018 at 6:02 AM, Yuanxiaofeng (XiAn) wrote: > On Tue, Aug 14, 2018 at 8:35PM Matthew Wilcox wrote: >> On Tue, Aug 14, 2018 at 08:17:31PM +0800, Xiaofeng Yuan wrote: >>>

Re: [PATCH RFC] usercopy: optimize stack check flow when the page-spanning test is disabled

2018-08-14 Thread Kees Cook
(Please use contextual quoting in replies... mixing contextual with top-posting becomes very hard to read...) On Tue, Aug 14, 2018 at 6:02 AM, Yuanxiaofeng (XiAn) wrote: > On Tue, Aug 14, 2018 at 8:35PM Matthew Wilcox wrote: >> On Tue, Aug 14, 2018 at 08:17:31PM +0800, Xiaofeng Yuan wrote: >>>

Re: [PATCH RFC] usercopy: optimize stack check flow when the page-spanning test is disabled

2018-08-14 Thread Matthew Wilcox
On Tue, Aug 14, 2018 at 01:02:55PM +, Yuanxiaofeng (XiAn) wrote: > 1, When the THREAD_SIZE is less than PAGE_SIZE, the stack will allocate > memory by kmem_cache_alloc_node(), it's slab memory and will execute > __check_heap_object(). > 2, When CONFIG_HARDENED_USERCOPY_PAGESPAN is enabled,

Re: [PATCH RFC] usercopy: optimize stack check flow when the page-spanning test is disabled

2018-08-14 Thread Matthew Wilcox
On Tue, Aug 14, 2018 at 01:02:55PM +, Yuanxiaofeng (XiAn) wrote: > 1, When the THREAD_SIZE is less than PAGE_SIZE, the stack will allocate > memory by kmem_cache_alloc_node(), it's slab memory and will execute > __check_heap_object(). > 2, When CONFIG_HARDENED_USERCOPY_PAGESPAN is enabled,

RE: [PATCH RFC] usercopy: optimize stack check flow when the page-spanning test is disabled

2018-08-14 Thread Yuanxiaofeng (XiAn)
1, When the THREAD_SIZE is less than PAGE_SIZE, the stack will allocate memory by kmem_cache_alloc_node(), it's slab memory and will execute __check_heap_object(). 2, When CONFIG_HARDENED_USERCOPY_PAGESPAN is enabled, the multiple-pages stacks will do some check in check_page_span(). So, I set

RE: [PATCH RFC] usercopy: optimize stack check flow when the page-spanning test is disabled

2018-08-14 Thread Yuanxiaofeng (XiAn)
1, When the THREAD_SIZE is less than PAGE_SIZE, the stack will allocate memory by kmem_cache_alloc_node(), it's slab memory and will execute __check_heap_object(). 2, When CONFIG_HARDENED_USERCOPY_PAGESPAN is enabled, the multiple-pages stacks will do some check in check_page_span(). So, I set