Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1553819
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: sg_io HARDENED_USERCOPY_PAGESPAN trace |
| Date | 2017-01-08 10:50 +0100 |
| Message-ID | <sXigW-4z0-37@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <sTL7Q-8pB-19@gated-at.bofh.it> <sU5zA-4WJ-15@gated-at.bofh.it> <sU6YF-5Yf-5@gated-at.bofh.it> <sU78m-63l-21@gated-at.bofh.it> <sVF7X-3Mr-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Jan 03, 2017 at 01:48:03PM -0800, Kees Cook wrote: > There are a lot of cases of "missing" __GFP_COMP, which is why > HARDENED_USERCOPY_PAGESPAN defaults to "n". > > > If this is on a devie using blk-mq the block core will use high > > order allocations (as high as possible) to allocate the requests > > for each queue, so struct request could very well span multiple > > pages. But I don't see what __GFP_COMP would have to do with > > user copy annoations. As all requests for a queue are freed > > togeth again there is no point in setting __GFP_COMP for the > > request allocations. > > Does it hurt anything to mark these pages as allocated "together" via > __GFP_COMP? It don't think it would hurt the block code - it only allocates the pages once, and frees them once. But I think hijacking your feature on top of a totally unrelated flag is a horrible idea. __GFP_COMP is about refcounting the allocation, not about anything else. The prime use case of high order allocations is to use them as a single memory object, which might include user copies. So as-is I think HARDENED_USERCOPY_PAGESPAN is a misfeature, it needs to be opt-in for allocations where we might not copy over the span of pages, not opt-out. And I suspect there aren't going to be all that many opt-out candidates. > > -Kees > > -- > Kees Cook > Nexus Security ---end quoted text---
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: sg_io HARDENED_USERCOPY_PAGESPAN trace Kees Cook <keescook@chromium.org> - 2017-01-03 22:50 +0100 Re: sg_io HARDENED_USERCOPY_PAGESPAN trace Christoph Hellwig <hch@infradead.org> - 2017-01-08 10:50 +0100
csiph-web