Dan Williams
2019-Jun-17 17:51 UTC
[Nouveau] [PATCH 08/25] memremap: move dev_pagemap callbacks into a separate structure
On Mon, Jun 17, 2019 at 5:27 AM Christoph Hellwig <hch at lst.de> wrote:> > The dev_pagemap is a growing too many callbacks. Move them into a > separate ops structure so that they are not duplicated for multiple > instances, and an attacker can't easily overwrite them. > > Signed-off-by: Christoph Hellwig <hch at lst.de> > Reviewed-by: Logan Gunthorpe <logang at deltatee.com> > Reviewed-by: Jason Gunthorpe <jgg at mellanox.com> > --- > drivers/dax/device.c | 11 ++++++---- > drivers/dax/pmem/core.c | 2 +- > drivers/nvdimm/pmem.c | 19 +++++++++------- > drivers/pci/p2pdma.c | 9 +++++--- > include/linux/memremap.h | 36 +++++++++++++++++-------------- > kernel/memremap.c | 18 ++++++++-------- > mm/hmm.c | 10 ++++++--- > tools/testing/nvdimm/test/iomap.c | 9 ++++---- > 8 files changed, 65 insertions(+), 49 deletions(-) >[..]> diff --git a/tools/testing/nvdimm/test/iomap.c b/tools/testing/nvdimm/test/iomap.c > index 219dd0a1cb08..a667d974155e 100644 > --- a/tools/testing/nvdimm/test/iomap.c > +++ b/tools/testing/nvdimm/test/iomap.c > @@ -106,11 +106,10 @@ EXPORT_SYMBOL(__wrap_devm_memremap); > > static void nfit_test_kill(void *_pgmap) > { > - struct dev_pagemap *pgmap = _pgmap;Whoops, needed to keep this line to avoid: tools/testing/nvdimm/test/iomap.c:109:11: error: ‘pgmap’ undeclared (first use in this function); did you mean ‘_pgmap’?
Christoph Hellwig
2019-Jun-17 19:55 UTC
[Nouveau] [PATCH 08/25] memremap: move dev_pagemap callbacks into a separate structure
On Mon, Jun 17, 2019 at 10:51:35AM -0700, Dan Williams wrote:> > - struct dev_pagemap *pgmap = _pgmap; > > Whoops, needed to keep this line to avoid: > > tools/testing/nvdimm/test/iomap.c:109:11: error: ‘pgmap’ undeclared > (first use in this function); did you mean ‘_pgmap’?So I really shouldn't be tripping over this anymore, but can we somehow this mess? - at least add it to the normal build system and kconfig deps instead of stashing it away so that things like buildbot can build it? - at least allow building it (under COMPILE_TEST) if needed even when pmem.ko and friends are built in the kernel?
Dan Williams
2019-Jun-17 21:09 UTC
[Nouveau] [PATCH 08/25] memremap: move dev_pagemap callbacks into a separate structure
On Mon, Jun 17, 2019 at 12:59 PM Christoph Hellwig <hch at lst.de> wrote:> > On Mon, Jun 17, 2019 at 10:51:35AM -0700, Dan Williams wrote: > > > - struct dev_pagemap *pgmap = _pgmap; > > > > Whoops, needed to keep this line to avoid: > > > > tools/testing/nvdimm/test/iomap.c:109:11: error: ‘pgmap’ undeclared > > (first use in this function); did you mean ‘_pgmap’? > > So I really shouldn't be tripping over this anymore, but can we somehow > this mess? > > - at least add it to the normal build system and kconfig deps instead > of stashing it away so that things like buildbot can build it? > - at least allow building it (under COMPILE_TEST) if needed even when > pmem.ko and friends are built in the kernel?Done: https://patchwork.kernel.org/patch/11000477/
Reasonably Related Threads
- [PATCH 08/25] memremap: move dev_pagemap callbacks into a separate structure
- [PATCH 08/25] memremap: move dev_pagemap callbacks into a separate structure
- [PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill
- [PATCH 07/22] memremap: move dev_pagemap callbacks into a separate structure
- [PATCH 15/25] memremap: provide an optional internal refcount in struct dev_pagemap