Re: [PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-05 Thread Christoph Hellwig
On Thu, Oct 03, 2019 at 02:38:43PM -0700, Kees Cook wrote: > > I think it would be reasonable to pull the is_vmalloc_addr() check inline, > > as that probably covers 90+% of badness (especially given vmapped stacks), > > and as you say should be reliably cheap everywhere. Callers are certainly > >

Re: [PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-04 Thread Kees Cook
On Fri, Oct 04, 2019 at 07:50:54PM +0100, Robin Murphy wrote: > On 03/10/2019 22:38, Kees Cook wrote: > > What do you think about the object_is_on_stack() check? That does a > > dereference through "current" to find the stack bounds... > > I guess it depends what the aim is - is it just to bail

Re: [PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-04 Thread Robin Murphy
On 03/10/2019 22:38, Kees Cook wrote: On Thu, Oct 03, 2019 at 10:42:45AM +0100, Robin Murphy wrote: On 03/10/2019 00:58, Kees Cook wrote: On Wed, Oct 02, 2019 at 10:15:43PM +0100, Robin Murphy wrote: Hi Kees, On 2019-10-02 9:46 pm, Kees Cook wrote: As we've seen from USB and other areas, we

Re: [PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-03 Thread Kees Cook
On Thu, Oct 03, 2019 at 10:42:45AM +0100, Robin Murphy wrote: > On 03/10/2019 00:58, Kees Cook wrote: > > On Wed, Oct 02, 2019 at 10:15:43PM +0100, Robin Murphy wrote: > > > Hi Kees, > > > > > > On 2019-10-02 9:46 pm, Kees Cook wrote: > > > > As we've seen from USB and other areas, we need to

Re: [PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-03 Thread Robin Murphy
On 03/10/2019 00:58, Kees Cook wrote: On Wed, Oct 02, 2019 at 10:15:43PM +0100, Robin Murphy wrote: Hi Kees, On 2019-10-02 9:46 pm, Kees Cook wrote: As we've seen from USB and other areas, we need to always do runtime checks for DMA operating on memory regions that might be remapped. This

Re: [PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-02 Thread kbuild test robot
Hi Kees, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [cannot apply to v5.4-rc1 next-20191002] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the

Re: [PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-02 Thread Kees Cook
On Wed, Oct 02, 2019 at 04:58:39PM -0700, Kees Cook wrote: > In the USB case, it'll actually refuse to do the operation. Should > dma_map_single() similarly fail? I could push these checks down into > dma_map_single(), which would be a no-change on behavior for USB and > gain the checks on all

Re: [PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-02 Thread Kees Cook
On Wed, Oct 02, 2019 at 10:15:43PM +0100, Robin Murphy wrote: > Hi Kees, > > On 2019-10-02 9:46 pm, Kees Cook wrote: > > As we've seen from USB and other areas, we need to always do runtime > > checks for DMA operating on memory regions that might be remapped. This > > consolidates the

Re: [PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-02 Thread kbuild test robot
Hi Kees, I love your patch! Perhaps something to improve: [auto build test WARNING on linus/master] [cannot apply to v5.4-rc1 next-20191002] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify

Re: [PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-02 Thread Robin Murphy
Hi Kees, On 2019-10-02 9:46 pm, Kees Cook wrote: As we've seen from USB and other areas, we need to always do runtime checks for DMA operating on memory regions that might be remapped. This consolidates the (existing!) checks and makes them on by default. A warning will be triggered for any

[PATCH] dma-mapping: Lift address space checks out of debug code

2019-10-02 Thread Kees Cook
As we've seen from USB and other areas, we need to always do runtime checks for DMA operating on memory regions that might be remapped. This consolidates the (existing!) checks and makes them on by default. A warning will be triggered for any drivers still using DMA on the stack (as has been seen