mm/hmm: Poison hmm_range during unregister
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 23 May 2019 14:40:24 +0000 (11:40 -0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 24 Jun 2019 20:38:18 +0000 (17:38 -0300)
commit2dcc3eb8ab50c9ca816cc60abfd94bea559d3e86
treef993a20fd2e73d85bbb61d1ba118eac9ae5410f5
parent187229c2ddd12a5bb5cd6bb3fbef9ecbc6eead92
mm/hmm: Poison hmm_range during unregister

Trying to misuse a range outside its lifetime is a kernel bug. Use poison
bytes to help detect this condition. Double unregister will reliably crash.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Jérôme Glisse <jglisse@redhat.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Acked-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Philip Yang <Philip.Yang@amd.com>
mm/hmm.c