Re: [PATCH v4] futex: Remove requirement for lock_page in get_futex_key
From: Thomas Gleixner
Date: Wed Jan 27 2016 - 15:11:28 EST
On Sat, 23 Jan 2016, Davidlohr Bueso wrote:
> + if (unlikely(!mapping)) {
> + int shmem_swizzled;
> +
> + /*
> + * Page lock is required to identify which special case above
> + * applies. If this is really a shmem page then the page lock
> + * will prevent unexpected transitions.
> + */
> + lock_page(page);
> + shmem_swizzled = PageSwapCache(page);
> unlock_page(page);
> put_page(page);
> + WARN_ON_ONCE(READ_ONCE(page->mapping));
You just did put_page(page). So dereferencing page is a nono. This needs to be
flipped around.
Thanks,
tglx