Message ID | 38e20a4939603718232859ee2170f54d8bcd8ddf.1703126594.git.nabijaczleweli@nabijaczleweli.xyz |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-7777-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp156259dyi; Wed, 20 Dec 2023 19:10:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOhhLvh0wO22eorVOjZLmSr4wXPAM0WdKfv2CI0KmaJXubO7nNO64MlNCOZ+XJ3YzKzP6T X-Received: by 2002:a17:906:c6:b0:a1e:4f60:c413 with SMTP id 6-20020a17090600c600b00a1e4f60c413mr7967859eji.95.1703128229593; Wed, 20 Dec 2023 19:10:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703128229; cv=none; d=google.com; s=arc-20160816; b=uGs4qONCe2UQrlZik08mW3DUZZhLMGhL7PloqwdhyJ+7cWtKEd374PVVnE+R2moV+6 5OgKzA/8jw+quQBj+yDTMoD0FCBng7HWRCDnno/ddBN4nGuiweSWlsw8iHOwPuMlGsvd YDn1feQHlBBQYBfdmaA+yzwp6d4qWtoAyGhFtRYWQAH04/wbeETOVHF0vmWoR3pPhfVv KxbTRQZ6Tm3UW/3ALIZbOwjyNtwHiuYG2z53lEudZXU4hd9K1PQ52HmLUvnZ3Ag+O1as tssIWd4PJrl+HFYV4pQoQS9okpitaeJgib2G+3J5vcjCztHphIWWQTmePbXGhr9OyzEl Qtbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:from:date:dkim-signature; bh=ZsMYl2weV04ayDQrJd/hXDe3H3GEvLz2FagOjMJlaME=; fh=J7y2iI74H57KW/pXLPd4VPoh3HWG7KkHYG2+d0N+3wY=; b=V6xHL5NSP/FMclXl40Dn/nMRJjef0zAlbETEbnI3c/Ha3ugjab84/Jc54erCzcgz6Q vkcwjFPcFCu4LI0chZtUwba7wZpm1thXIN6pJeAt0nKpxHlWbGqKaNMx2p0VaYol9v4q SweT+v9sNE3g5QKWTbMSfCB9gjoHCrdiuxNwPtRjVWCH/9PrLAkNhoiZ+3wuFNnTm5Wy AuzO1/QO2bpMtGL138E0uK8zbWsLYuJEvo6I32HRnAAQoFPfJP/E1tmOayi9LjZR2es7 eACGni/Rbgfb68Dm9KDabuBqklN28cCB4yCpxfG8pMTDROMZASWTgwX2zcVy03GX4ZdS CauA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202305 header.b=BIL6JbTv; spf=pass (google.com: domain of linux-kernel+bounces-7777-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7777-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id zy21-20020a17090734d500b00a235a058642si422992ejb.181.2023.12.20.19.10.29 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 19:10:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7777-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202305 header.b=BIL6JbTv; spf=pass (google.com: domain of linux-kernel+bounces-7777-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7777-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 39F0E1F244DA for <ouuuleilei@gmail.com>; Thu, 21 Dec 2023 03:10:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F2C9FBFC; Thu, 21 Dec 2023 03:09:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nabijaczleweli.xyz header.i=@nabijaczleweli.xyz header.b="BIL6JbTv" X-Original-To: linux-kernel@vger.kernel.org Received: from tarta.nabijaczleweli.xyz (tarta.nabijaczleweli.xyz [139.28.40.42]) (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 2771046B5; Thu, 21 Dec 2023 03:09:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nabijaczleweli.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nabijaczleweli.xyz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1703128140; bh=rt0AEnnzw/E9eyte+sfYqKcDzKN6TKrOk/5CzjvNe7s=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=BIL6JbTvgXjrABthVY0jcMbCt19zMUjX4k54dfyXJIc/Y4RVTGC+gix4NQLV1c5Si m75xgd9AhG5ESQDY10f/8CxmRNrT8/UczSC0W5zsHcSkJi3hp99ecCNWBvpEv8h1C7 3RVtyLsMkNskWwos4UWDLcqGyiGb6TyWBC75cpycTIZxbDtZL2x8RXuiNAU4N3xWyS +zIOInw+oBlHINKWcGbIf06mRq1WcuHYIE3cIwdlWzi/jxIH1C6QP4EQEAKoKLJD2O YnbRNbJTiv95+VS+56TJXpJJUAJPlCOWQeiEBTfHikSe0csefBFY629mK5XL0HWc1h jmImqQTZPtOtw== Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 5352913774; Thu, 21 Dec 2023 04:09:00 +0100 (CET) Date: Thu, 21 Dec 2023 04:09:00 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= <nabijaczleweli@nabijaczleweli.xyz> Cc: Jens Axboe <axboe@kernel.dk>, Christian Brauner <brauner@kernel.org>, Alexander Viro <viro@zeniv.linux.org.uk>, linux-fsdevel@vger.kernel.org, Wenjia Zhang <wenjia@linux.ibm.com>, Jan Karcher <jaka@linux.ibm.com>, "D. Wythe" <alibuda@linux.alibaba.com>, Tony Lu <tonylu@linux.alibaba.com>, Wen Gu <guwen@linux.alibaba.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 04/11] net/smc: smc_splice_read: always request MSG_DONTWAIT Message-ID: <38e20a4939603718232859ee2170f54d8bcd8ddf.1703126594.git.nabijaczleweli@nabijaczleweli.xyz> References: <cover.1703126594.git.nabijaczleweli@nabijaczleweli.xyz> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bmqh3eyp5rhgpey6" Content-Disposition: inline In-Reply-To: <cover.1703126594.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20231103-116-3b855e-dirty X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785859386662695337 X-GMAIL-MSGID: 1785859386662695337 |
Series |
Avoid unprivileged splice(file->)/(->socket) pipe exclusion
|
|
Commit Message
Ahelenia Ziemiańska
Dec. 21, 2023, 3:09 a.m. UTC
Otherwise we risk sleeping with the pipe locked for indeterminate
lengths of time ‒ this meant that splice(smc -> pipe) with no data
would hold the pipe lock, and any open/read/write/close on the pipe
would enter uninterruptible sleep.
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
net/smc/af_smc.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 73eebddbbf41..a11a966d031a 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -3248,12 +3248,8 @@ static ssize_t smc_splice_read(struct socket *sock, loff_t *ppos, rc = -ESPIPE; goto out; } - if (flags & SPLICE_F_NONBLOCK) - flags = MSG_DONTWAIT; - else - flags = 0; SMC_STAT_INC(smc, splice_cnt); - rc = smc_rx_recvmsg(smc, NULL, pipe, len, flags); + rc = smc_rx_recvmsg(smc, NULL, pipe, len, MSG_DONTWAIT); } out: release_sock(sk);