I do not see any check after we have taken the lock to verify that we
locked the correct object. Was there a second version of the patch?
You then are using an object from the anon_vma (the pointer) without a
lock! This is unstable therefore unless there are other constraints. The
anon_vma->lock must be taken before derefencing that pointer. The page may
have been unmapped and mapped again between the two checks. Unlikely but
possible.
I do not see a second check (*after* taking the lock) in the patch and the
way the lock is taken can be a problem in itself.
--