]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sparc64: Ignored DAX ref count causes lockup
authorRob Gardner <rob.gardner@oracle.com>
Mon, 10 Apr 2017 19:24:48 +0000 (13:24 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 24 Apr 2017 04:43:26 +0000 (21:43 -0700)
commit993d1d94fd85e3fa67e9730fab1d71668aba25cc
tree06b2d04f70c692676f3ed1dd9bc3b87533fcdfd8
parenta083c2c57ca342f18ea051c307bf711c1ba2abb2
sparc64: Ignored DAX ref count causes lockup

Orabug: 25870705

The dax_mm structure has a reference count that respresents
the number of dax_vma structures that point to it. The reference
count is duly incremented and decremented each time memory is
allocated via the dax_alloc/mmap path. However, the reference
count is never used for its intended purpose, which is to
prevent the dax_mm structure from being freed while there
are references to it. The result of this is that if dax_free
is called after the process's dax_mm is cleaned up, the dax_vma
will have a reference to the freed object, leading to panics
due to null pointers and/or lockups due to inalid spinlock state.
Code changed to actually check the reference count before freeing
a dax_mm.

Signed-off-by: Rob Gardner <rob.gardner@oracle.com>
Reviewed-by: Sanath Kumar <sanath.s.kumar@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/sparc/dax/dax_mm.c