From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935049AbdEOP7c (ORCPT ); Mon, 15 May 2017 11:59:32 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:52522 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932368AbdEOP73 (ORCPT ); Mon, 15 May 2017 11:59:29 -0400 From: Christoph Hellwig To: viro@ZenIV.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] coredump: call do_unlinkat directly instead of sys_unlink Date: Mon, 15 May 2017 17:59:22 +0200 Message-Id: <20170515155922.1847-2-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170515155922.1847-1-hch@lst.de> References: <20170515155922.1847-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 592683711c64..10a020639a94 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.11.0