From patchwork Sat Nov 2 07:31:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 13860008 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 580C778289; Sat, 2 Nov 2024 07:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730532712; cv=none; b=eB6TH/kn1AdBiU5v4HV/ZWHlOOBbRj4prBBvKia5GSUTDnfF7KEupELI/GxVC+yqKiExB8LXY0gWQnxi4zLOZ4nh2be0AHsXPMM69UVogroT8w7QXgtojr3QO7WWaETFpgWqi+D+mEveZydWCDK1eicP0ntxyEcLb1EFUwPxfCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730532712; c=relaxed/simple; bh=tQsnmqXW2K56L9+z+oxlf76cDjO82I5BaJt0mYZtnFU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IhZymxvNZLxnP7zFmbcHfaJs9hZhO9a1awRNB46egdG85GDJTcxTRLtxTrMfai/Pe2fmtlqeYI+ppS9VV2yOeSNnOc88gQXEhngAOMUJnJPqyn9WEOqSu2ymLAdRPJR3WJVr9VoBfzxUpKsUdslb5LPGpoGyGhbXAkmPFwYZ5Jk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=AuWhRiTB; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="AuWhRiTB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=ehBlgSNmphaRaQWd8qdZFfTUDathgqXFkHwLaDfH6SU=; b=AuWhRiTBnZDeOy8WrMRhSSryoY 53S5iG0EvqNonTlG8PKexHPx4fVR0qHNviIaRXkPsSGsX0hdxmJdkfZ0dNsybk/wi/gEBnGQ6ji2L kCFHnErGLSFGi2CjyfCURwRIuDfWNL8Dt8PHp6lQhSBtus+9aWlbqFxICRRiPGk5BncAn8MKEd/mN hEF20MWhi0dvfxAfEh+EYwsHCVyN9U6pM1v1+9ODgtRQrFfewx95gWB5mk5TDv0E6A5zTZrbBFryV z0JO7mfLxbUx6tw8Hgrh9b59tCUJ6pWQk7eUzDAFyxxpzicgmqN3EePe/14TKJBptpCBtDoeMriVL n+D9BB7g==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.98 #2 (Red Hat Linux)) id 1t78bt-0000000AJFD-2lOq; Sat, 02 Nov 2024 07:31:49 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Christian Brauner , io-uring@vger.kernel.org, =?utf-8?q?Christian_G=C3=B6ttsche?= Subject: [PATCH v2 04/13] io_[gs]etxattr_prep(): just use getname() Date: Sat, 2 Nov 2024 07:31:40 +0000 Message-ID: <20241102073149.2457240-4-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102073149.2457240-1-viro@zeniv.linux.org.uk> References: <20241102072834.GQ1350452@ZenIV> <20241102073149.2457240-1-viro@zeniv.linux.org.uk> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Al Viro getname_flags(pathname, LOOKUP_FOLLOW) is obviously bogus - following trailing symlinks has no impact on how to copy the pathname from userland... Reviewed-by: Christian Brauner Signed-off-by: Al Viro Reviewed-by: Jens Axboe --- io_uring/xattr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io_uring/xattr.c b/io_uring/xattr.c index 4b68c282c91a..967c5d8da061 100644 --- a/io_uring/xattr.c +++ b/io_uring/xattr.c @@ -96,7 +96,7 @@ int io_getxattr_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) path = u64_to_user_ptr(READ_ONCE(sqe->addr3)); - ix->filename = getname_flags(path, LOOKUP_FOLLOW); + ix->filename = getname(path); if (IS_ERR(ix->filename)) { ret = PTR_ERR(ix->filename); ix->filename = NULL; @@ -189,7 +189,7 @@ int io_setxattr_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) path = u64_to_user_ptr(READ_ONCE(sqe->addr3)); - ix->filename = getname_flags(path, LOOKUP_FOLLOW); + ix->filename = getname(path); if (IS_ERR(ix->filename)) { ret = PTR_ERR(ix->filename); ix->filename = NULL;