Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1250032pxa; Thu, 20 Aug 2020 06:46:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGNu/qo0k9R6ELCDcB7xr8MyehjdP1HiU64yg6qcZ+P9inLcnI0lw8suW/ysX8chvrdGCI X-Received: by 2002:a17:906:f0cc:: with SMTP id dk12mr3200976ejb.97.1597931167434; Thu, 20 Aug 2020 06:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931167; cv=none; d=google.com; s=arc-20160816; b=I5YZz4jl/dcqmWwFVeE5P+orMTZTe0VwzWYEOMNMlLq4pPQAMpPpgZUQIrZiW+qfe5 7JwxE8M203SDwqTBfFsW6MaDHsRQpfkO2vMzwB0a2jHz7vVtL/ebCbv0VkcL48iP1d/x WPW8xqDbw/aDR5JFFCVVaruSUYLLAvtB7/OWcuSH+cHyqpL0g9fW3KJG1QZ6Dt5wcT0c 3ln1lvmRIjNp61jgoA7xOiotOv9OSRto3VViQNeVgDyobiCeAg3QzZWMW2sFfy4+DhXc LdGtJohZ4e9Oq7vfyzh2T5/vfDVIEYlzooLWhTYSB2VhOIAqZfUErY+1kdFb/muzMoTO 1AjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gbGI3g3ZyBbbJlFfo6QlzwErFHm1SN8KTXJlrOY8St0=; b=CWj1A22qdwm7bIVES1rmfBsFbiZqPm/Nfcw89qTxT8GLjaAHRw8fe2GJ8XO3uB3Boz FJltttJhZcSBxayaBC9Z4spgfLRr+dBEl1cdKOvMRGJXxwNVjDhFXMyaStIm35iyK0IC 7Zlg7iDPLrEG64n0LSIjf0uKo3J+HDhmRXBgXpjx36+xoQLaw9VvAa8dxy+ipOYBoc0o Ol28lw2L8QMKgoEEDSWWFqf3qDgYYMX01QlRLx6PHIW1Plk9Ixv+WnxL7o0KuS1Ez/L1 KJO6EthCQo9lbfei1AEgCm13c7kzlnteHDss2vGKFxlle1mm/sd1uRWBricifMi9ZJ67 LyCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oNKBTJSJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l21si1140376eje.61.2020.08.20.06.45.43; Thu, 20 Aug 2020 06:46:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oNKBTJSJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730829AbgHTNmy (ORCPT + 99 others); Thu, 20 Aug 2020 09:42:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:39776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727068AbgHTJ3T (ORCPT ); Thu, 20 Aug 2020 05:29:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DB1622B4B; Thu, 20 Aug 2020 09:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915759; bh=KDpAiWjt9PyK7QuzfiSbWuUz/G+w+2qmU0TYOWkztIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oNKBTJSJU4PSrlfMVVZTWTt+CS0ed2nZZSF4KQpoFygWUCmYIQEd9t2Xo/d/lHvQq FiKVF58+3jbg3poXPtAJipIGMDasCBy3MiONUMOT/l2IuoaZSZzHxjBFglBOIWTv/A xXZcOWBTTfKM2RQHs4JuHPTTh5Ojw44YbrADALBw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeff Layton , Ilya Dryomov Subject: [PATCH 5.8 095/232] ceph: set sec_context xattr on symlink creation Date: Thu, 20 Aug 2020 11:19:06 +0200 Message-Id: <20200820091617.438788458@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeff Layton commit b748fc7a8763a5b3f8149f12c45711cd73ef8176 upstream. Symlink inodes should have the security context set in their xattrs on creation. We already set the context on creation, but we don't attach the pagelist. The effect is that symlink inodes don't get an SELinux context set on them at creation, so they end up unlabeled instead of inheriting the proper context. Make it do so. Cc: stable@vger.kernel.org Signed-off-by: Jeff Layton Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov Signed-off-by: Greg Kroah-Hartman --- fs/ceph/dir.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -930,6 +930,10 @@ static int ceph_symlink(struct inode *di req->r_num_caps = 2; req->r_dentry_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_AUTH_EXCL; req->r_dentry_unless = CEPH_CAP_FILE_EXCL; + if (as_ctx.pagelist) { + req->r_pagelist = as_ctx.pagelist; + as_ctx.pagelist = NULL; + } err = ceph_mdsc_do_request(mdsc, dir, req); if (!err && !req->r_reply_info.head->is_dentry) err = ceph_handle_notrace_create(dir, dentry);