[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140617055042.GA3064@moon>
Date: Tue, 17 Jun 2014 09:50:42 +0400
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Konstantin Khlebnikov <koct9i@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Sasha Levin <sasha.levin@...cle.com>,
Jason Baron <jbaron@...mai.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Stable <stable@...r.kernel.org>
Subject: Re: [PATCH] epoll: fix use-after-free in eventpoll_release_file
On Tue, Jun 17, 2014 at 06:58:05AM +0400, Konstantin Khlebnikov wrote:
> This fixes use-after-free of epi->fllink.next inside list loop macro.
> This loop actually releases elements in the body. List is rcu-protected
> but here we cannot hold rcu_read_lock because we need to lock mutex inside.
>
> Obvious solution is to use list_for_each_entry_safe(). RCU-ness isn't essential
> because nobody can change this list under us, it's final fput for this file.
>
> Bug is here since ae10b2b4eb01bedc91d29d5c5bb9e416fd806c40
> ("epoll: optimize EPOLL_CTL_DEL using rcu")
>
> Signed-off-by: Konstantin Khlebnikov <koct9i@...il.com>
> Reported-by: Cyrill Gorcunov <gorcunov@...nvz.org>
> Cc: Stable <stable@...r.kernel.org> # 3.13+
> Cc: Sasha Levin <sasha.levin@...cle.com>
> Cc: Jason Baron <jbaron@...mai.com>
Acked-by: Cyrill Gorcunov <gorcunov@...nvz.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists