Return-Path: Received: from bombadil.infradead.org ([65.50.211.133]:39733 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756598AbdKDKow (ORCPT ); Sat, 4 Nov 2017 06:44:52 -0400 From: Christoph Hellwig To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH 2/2] coredump: call do_unlinkat directly instead of sys_unlink Date: Sat, 4 Nov 2017 13:44:46 +0300 Message-Id: <20171104104446.20792-2-hch@lst.de> In-Reply-To: <20171104104446.20792-1-hch@lst.de> References: <20171104104446.20792-1-hch@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: And stop messing with the address limit. Signed-off-by: Christoph Hellwig --- fs/coredump.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/coredump.c b/fs/coredump.c index 0eec03696707..cd72a4ca0cec 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -679,16 +679,11 @@ void do_coredump(const siginfo_t *siginfo) * privs and don't want to unlink another user's coredump. */ if (!need_suid_safe) { - mm_segment_t old_fs; - - old_fs = get_fs(); - set_fs(KERNEL_DS); /* * If it doesn't exist, that's fine. If there's some * other problem, we'll catch it at the filp_open(). */ - (void) sys_unlink((const char __user *)cn.corename); - set_fs(old_fs); + do_unlinkat(AT_FDCWD, getname_kernel(cn.corename)); } /* -- 2.14.2