Messages in this thread | | | Date | Wed, 31 May 2017 17:12:37 +0200 | From | Wolfram Sang <> | Subject | Re: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity |
| |
> > +/* only works in process context because of stack detection */ > > +static inline bool is_dma_capable_addr(void *addr) > > +{ > > + return !(is_vmalloc_or_module_addr(addr) || > > + object_is_on_stack(addr)); > > This does not catch kmap'ed buffers which are not directly DMA'able. > I would suggest to use virt_addr_valid() instead. Something like: > > return (virt_addr_valid(addr) && !object_is_on_stack(addr));
Hehe, here is the part of the commit message I have for this code:
===
Second note: I am not even sure the checks complete (kmapped mem?). But that just strengthens the argument of having on centralized place IMO :)
===
So, thanks for the heads up!
[unhandled content-type:application/pgp-signature]
| |