Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753429AbdLNVIW (ORCPT ); Thu, 14 Dec 2017 16:08:22 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:48956 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508AbdLNVIT (ORCPT ); Thu, 14 Dec 2017 16:08:19 -0500 Date: Thu, 14 Dec 2017 21:08:17 +0000 From: Al Viro To: Cong Wang Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Linus Torvalds , stable@vger.kernel.org Subject: Re: [PATCH] exit: move exit_task_namespaces() after exit_task_work() Message-ID: <20171214210817.GF21978@ZenIV.linux.org.uk> References: <20171214201757.5393-1-xiyou.wangcong@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171214201757.5393-1-xiyou.wangcong@gmail.com> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 528 Lines: 10 On Thu, Dec 14, 2017 at 12:17:57PM -0800, Cong Wang wrote: > syzbot reported we have a use-after-free when mqueue_evict_inode() > is called on __cleanup_mnt() path, where the ipc ns is already > freed by the previous exit_task_namespaces(). We can just move > it after after exit_task_work() to avoid this use-after-free. What's to prevent somebody else holding a reference to the same inode past the exit(2)? IOW, I don't believe that this is fixing anything - in the best case, your patch papers over a specific reproducer.