stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Trond Myklebust <trond.myklebust@hammerspace.com>
Subject: [PATCH 5.15 094/102] SUNRPC: Ensure that the gssproxy client can start in a connected state
Date: Mon, 16 May 2022 21:37:08 +0200	[thread overview]
Message-ID: <20220516193626.696341017@linuxfoundation.org> (raw)
In-Reply-To: <20220516193623.989270214@linuxfoundation.org>

From: Trond Myklebust <trond.myklebust@hammerspace.com>

commit fd13359f54ee854f00134abc6be32da94ec53dbf upstream.

Ensure that the gssproxy client connects to the server from the gssproxy
daemon process context so that the AF_LOCAL socket connection is done
using the correct path and namespaces.

Fixes: 1d658336b05f ("SUNRPC: Add RPC based upcall mechanism for RPCGSS auth")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/sunrpc/clnt.h          |    1 +
 net/sunrpc/auth_gss/gss_rpc_upcall.c |    1 +
 net/sunrpc/clnt.c                    |   33 +++++++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)

--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -159,6 +159,7 @@ struct rpc_add_xprt_test {
 #define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT	(1UL << 9)
 #define RPC_CLNT_CREATE_SOFTERR		(1UL << 10)
 #define RPC_CLNT_CREATE_REUSEPORT	(1UL << 11)
+#define RPC_CLNT_CREATE_CONNECTED	(1UL << 12)
 
 struct rpc_clnt *rpc_create(struct rpc_create_args *args);
 struct rpc_clnt	*rpc_bind_new_program(struct rpc_clnt *,
--- a/net/sunrpc/auth_gss/gss_rpc_upcall.c
+++ b/net/sunrpc/auth_gss/gss_rpc_upcall.c
@@ -98,6 +98,7 @@ static int gssp_rpc_create(struct net *n
 		 * done without the correct namespace:
 		 */
 		.flags		= RPC_CLNT_CREATE_NOPING |
+				  RPC_CLNT_CREATE_CONNECTED |
 				  RPC_CLNT_CREATE_NO_IDLE_TIMEOUT
 	};
 	struct rpc_clnt *clnt;
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -76,6 +76,7 @@ static int	rpc_encode_header(struct rpc_
 static int	rpc_decode_header(struct rpc_task *task,
 				  struct xdr_stream *xdr);
 static int	rpc_ping(struct rpc_clnt *clnt);
+static int	rpc_ping_noreply(struct rpc_clnt *clnt);
 static void	rpc_check_timeout(struct rpc_task *task);
 
 static void rpc_register_client(struct rpc_clnt *clnt)
@@ -483,6 +484,12 @@ static struct rpc_clnt *rpc_create_xprt(
 			rpc_shutdown_client(clnt);
 			return ERR_PTR(err);
 		}
+	} else if (args->flags & RPC_CLNT_CREATE_CONNECTED) {
+		int err = rpc_ping_noreply(clnt);
+		if (err != 0) {
+			rpc_shutdown_client(clnt);
+			return ERR_PTR(err);
+		}
 	}
 
 	clnt->cl_softrtry = 1;
@@ -2704,6 +2711,10 @@ static const struct rpc_procinfo rpcproc
 	.p_decode = rpcproc_decode_null,
 };
 
+static const struct rpc_procinfo rpcproc_null_noreply = {
+	.p_encode = rpcproc_encode_null,
+};
+
 static void
 rpc_null_call_prepare(struct rpc_task *task, void *data)
 {
@@ -2753,6 +2764,28 @@ static int rpc_ping(struct rpc_clnt *cln
 	if (IS_ERR(task))
 		return PTR_ERR(task);
 	status = task->tk_status;
+	rpc_put_task(task);
+	return status;
+}
+
+static int rpc_ping_noreply(struct rpc_clnt *clnt)
+{
+	struct rpc_message msg = {
+		.rpc_proc = &rpcproc_null_noreply,
+	};
+	struct rpc_task_setup task_setup_data = {
+		.rpc_client = clnt,
+		.rpc_message = &msg,
+		.callback_ops = &rpc_null_ops,
+		.flags = RPC_TASK_SOFT | RPC_TASK_SOFTCONN | RPC_TASK_NULLCREDS,
+	};
+	struct rpc_task	*task;
+	int status;
+
+	task = rpc_run_task(&task_setup_data);
+	if (IS_ERR(task))
+		return PTR_ERR(task);
+	status = task->tk_status;
 	rpc_put_task(task);
 	return status;
 }



  parent reply	other threads:[~2022-05-16 20:07 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16 19:35 [PATCH 5.15 000/102] 5.15.41-rc1 review Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 001/102] batman-adv: Dont skb_split skbuffs with frag_list Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 002/102] iwlwifi: iwl-dbg: Use del_timer_sync() before freeing Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 003/102] hwmon: (tmp401) Add OF device ID table Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 004/102] mac80211: Reset MBSSID parameters upon connection Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 005/102] net: Fix features skip in for_each_netdev_feature() Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 006/102] net: mscc: ocelot: fix last VCAP IS1/IS2 filter persisting in hardware when deleted Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 007/102] net: mscc: ocelot: fix VCAP IS2 filters matching on both lookups Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 008/102] net: mscc: ocelot: restrict tc-trap actions to VCAP IS2 lookup 0 Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 009/102] net: mscc: ocelot: avoid corrupting hardware counters when moving VCAP filters Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 010/102] fbdev: simplefb: Cleanup fb_info in .fb_destroy rather than .remove Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 011/102] fbdev: efifb: " Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 012/102] fbdev: vesafb: " Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 013/102] platform/surface: aggregator: Fix initialization order when compiling as builtin module Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 014/102] ice: Fix race during aux device (un)plugging Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 015/102] ice: fix PTP stale Tx timestamps cleanup Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 016/102] ipv4: drop dst in multicast routing path Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 017/102] drm/nouveau: Fix a potential theorical leak in nouveau_get_backlight_name() Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 018/102] netlink: do not reset transport header in netlink_recvmsg() Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 019/102] net: chelsio: cxgb4: Avoid potential negative array offset Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 020/102] fbdev: efifb: Fix a use-after-free due early fb_info cleanup Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 021/102] sfc: Use swap() instead of open coding it Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 022/102] net: sfc: fix memory leak due to ptp channel Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 023/102] mac80211_hwsim: call ieee80211_tx_prepare_skb under RCU protection Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 024/102] nfs: fix broken handling of the softreval mount option Greg Kroah-Hartman
2022-05-16 19:35 ` [PATCH 5.15 025/102] ionic: fix missing pci_release_regions() on error in ionic_probe() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 026/102] dim: initialize all struct fields Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 027/102] hwmon: (ltq-cputemp) restrict it to SOC_XWAY Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 028/102] procfs: prevent unprivileged processes accessing fdinfo dir Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 029/102] selftests: vm: Makefile: rename TARGETS to VMTARGETS Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 030/102] arm64: vdso: fix makefile dependency on vdso.so Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 031/102] virtio: fix virtio transitional ids Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 032/102] s390/ctcm: fix variable dereferenced before check Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 033/102] s390/ctcm: fix potential memory leak Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 034/102] s390/lcs: fix variable dereferenced before check Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 035/102] net/sched: act_pedit: really ensure the skb is writable Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 036/102] net: ethernet: mediatek: ppe: fix wrong size passed to memset() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 037/102] net: bcmgenet: Check for Wake-on-LAN interrupt probe deferral Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 038/102] drm/vc4: hdmi: Fix build error for implicit function declaration Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 039/102] net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 040/102] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 041/102] net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 042/102] tls: Fix context leak on tls_device_down Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 043/102] drm/vmwgfx: Fix fencing on SVGAv3 Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 044/102] gfs2: Fix filesystem block deallocation for short writes Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 045/102] hwmon: (f71882fg) Fix negative temperature Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 046/102] RDMA/irdma: Fix deadlock in irdma_cleanup_cm_core() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 047/102] iommu: arm-smmu: disable large page mappings for Nvidia arm-smmu Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 048/102] ASoC: max98090: Reject invalid values in custom control put() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 049/102] ASoC: max98090: Generate notifications on changes for custom control Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 050/102] ASoC: ops: Validate input values in snd_soc_put_volsw_range() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 051/102] s390: disable -Warray-bounds Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 052/102] ASoC: SOF: Fix NULL pointer exception in sof_pci_probe callback Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 053/102] net: emaclite: Dont advertise 1000BASE-T and do auto negotiation Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 054/102] net: sfp: Add tx-fault workaround for Huawei MA5671A SFP ONT Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 055/102] secure_seq: use the 64 bits of the siphash for port offset calculation Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 056/102] tcp: use different parts of the port_offset for index and offset Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 057/102] tcp: resalt the secret every 10 seconds Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 058/102] tcp: add small random increments to the source port Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 059/102] tcp: dynamically allocate the perturb table used by source ports Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 060/102] tcp: increase source port perturb table to 2^16 Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 061/102] tcp: drop the hash_32() part from the index calculation Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 062/102] interconnect: Restore sync state by ignoring ipa-virt in provider count Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 063/102] firmware_loader: use kernel credentials when reading firmware Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 064/102] KVM: PPC: Book3S PR: Enable MSR_DR for switch_mmu_context() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 065/102] usb: xhci-mtk: fix fs isocs transfer error Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 066/102] x86/mm: Fix marking of unused sub-pmd ranges Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 067/102] tty/serial: digicolor: fix possible null-ptr-deref in digicolor_uart_probe() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 068/102] tty: n_gsm: fix buffer over-read in gsm_dlci_data() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 069/102] tty: n_gsm: fix mux activation issues in gsm_config() Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 070/102] usb: cdc-wdm: fix reading stuck on device close Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 071/102] usb: typec: tcpci: Dont skip cleanup in .remove() on error Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 072/102] usb: typec: tcpci_mt6360: Update for BMC PHY setting Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 073/102] USB: serial: pl2303: add device id for HP LM930 Display Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 074/102] USB: serial: qcserial: add support for Sierra Wireless EM7590 Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 075/102] USB: serial: option: add Fibocom L610 modem Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 076/102] USB: serial: option: add Fibocom MA510 modem Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 077/102] slimbus: qcom: Fix IRQ check in qcom_slim_probe Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 078/102] fsl_lpuart: Dont enable interrupts too early Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 079/102] serial: 8250_mtk: Fix UART_EFR register address Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 080/102] serial: 8250_mtk: Fix register address for XON/XOFF character Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 081/102] ceph: fix setting of xattrs on async created inodes Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 082/102] Revert "mm/memory-failure.c: skip huge_zero_page in memory_failure()" Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 083/102] mm/huge_memory: do not overkill when splitting huge_zero_page Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 084/102] drm/vmwgfx: Disable command buffers on svga3 without gbobjects Greg Kroah-Hartman
2022-05-16 19:36 ` [PATCH 5.15 085/102] drm/nouveau/tegra: Stop using iommu_present() Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 086/102] i40e: i40e_main: fix a missing check on list iterator Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 087/102] net: atlantic: always deep reset on pm op, fixing up my null deref regression Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 088/102] net: phy: Fix race condition on link status change Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 089/102] writeback: Avoid skipping inode writeback Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 090/102] cgroup/cpuset: Remove cpus_allowed/mems_allowed setup in cpuset_init_smp() Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 091/102] arm[64]/memremap: dont abuse pfn_valid() to ensure presence of linear map Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 092/102] net: phy: micrel: Do not use kszphy_suspend/resume for KSZ8061 Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 093/102] net: phy: micrel: Pass .probe for KS8737 Greg Kroah-Hartman
2022-05-16 19:37 ` Greg Kroah-Hartman [this message]
2022-05-16 19:37 ` [PATCH 5.15 095/102] drm/vmwgfx: Initialize drm_mode_fb_cmd2 Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 096/102] Revert "drm/amd/pm: keep the BACO feature enabled for suspend" Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 097/102] dma-buf: call dma_buf_stats_setup after dmabuf is in valid list Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 098/102] mm/hwpoison: use pr_err() instead of dump_page() in get_any_page() Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 099/102] SUNRPC: Ensure we flush any closed sockets before xs_xprt_free() Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 100/102] ping: fix address binding wrt vrf Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 101/102] usb: gadget: uvc: rename function to be more consistent Greg Kroah-Hartman
2022-05-16 19:37 ` [PATCH 5.15 102/102] usb: gadget: uvc: allow for application to cleanly shutdown Greg Kroah-Hartman
2022-05-17  4:12 ` [PATCH 5.15 000/102] 5.15.41-rc1 review Shuah Khan
2022-05-17  7:41 ` Jon Hunter
2022-05-17  8:08 ` Fox Chen
2022-05-17 11:03 ` Sudip Mukherjee
2022-05-17 11:15 ` Naresh Kamboju
2022-05-17 15:59 ` Ron Economos
2022-05-17 16:22 ` Florian Fainelli
2022-05-17 19:31 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220516193626.696341017@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).