From patchwork Mon Feb 12 14:34:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Antipov X-Patchwork-Id: 13553372 X-Patchwork-Delegate: kuba@kernel.org Received: from forward205c.mail.yandex.net (forward205c.mail.yandex.net [178.154.239.216]) (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 198E83C07B for ; Mon, 12 Feb 2024 14:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.154.239.216 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707748979; cv=none; b=XeQiL2uIf7xyLbRzH+iGbzFFTKpyv7JJyL/2cQsYuAg6lm9FpKwPUB2onOJGdH9BzcZ53VmhalGG0rHLYxe5BqRMoBCPc13nf1INmAnzoH848cYyO0KjaqJ3nmwDteXwLm6EoOzT0yY3SfBARPnKn46iGr0Hk7LixX91S66HsXc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707748979; c=relaxed/simple; bh=+lZciFymIFJwD/jU7Qojsl0yl5ukkvb8Exw+rSCLWAM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XPzEteLXdCAB5I2Tz6bKXUxr+FWAZKgoe9KxzfNIRQouL/i/lUbAfGG16rr1n+y3QXEBWBqZqgV6vrLGaYjU0dcXD5a6+OM+oRBJ8rf5dADQylQdx5VDxRCAeaeL/MAApIv0EH2KH6W2CkNhBT/NsbEEvcfABIveCSvcDsu3B7U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yandex.ru; spf=pass smtp.mailfrom=yandex.ru; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b=RI2qJGKY; arc=none smtp.client-ip=178.154.239.216 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yandex.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b="RI2qJGKY" Received: from forward103b.mail.yandex.net (forward103b.mail.yandex.net [IPv6:2a02:6b8:c02:900:1:45:d181:d103]) by forward205c.mail.yandex.net (Yandex) with ESMTPS id D37B763FD5 for ; Mon, 12 Feb 2024 17:35:16 +0300 (MSK) Received: from mail-nwsmtp-smtp-production-main-36.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-36.sas.yp-c.yandex.net [IPv6:2a02:6b8:c08:edad:0:640:6050:0]) by forward103b.mail.yandex.net (Yandex) with ESMTPS id 6A525608F4; Mon, 12 Feb 2024 17:35:08 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-36.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 6Zn1e7RxTKo0-XevZilbG; Mon, 12 Feb 2024 17:35:07 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1707748507; bh=KutVQaZZTcGNOKFqN5L9OMGEn+KX5O52pWznSbShxpA=; h=Message-ID:Date:Cc:Subject:To:From; b=RI2qJGKYeKBQtxrtGxO+TuFQVhrqD3MJCh69K2Pz30cZogM1gSs+4eDGtCGFE0wMW hs77pV5hEt0gvAxK0LBGOQ6o6i0NIPkOFZxQgeu2fuEIsfNbObSNv9MpjlzVDomNNk VRA+0jl5J+JmTRakd89Isa5sgLYCSeodJaNq45KY= Authentication-Results: mail-nwsmtp-smtp-production-main-36.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Ursula Braun Cc: Karsten Graul , Jan Karcher , "David S . Miller" , netdev@vger.kernel.org, lvc-project@linuxtesting.org, Dmitry Antipov Subject: [PATCH] net: smc: fix spurious error message from __sock_release() Date: Mon, 12 Feb 2024 17:34:02 +0300 Message-ID: <20240212143402.23181-1-dmantipov@yandex.ru> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Commit 67f562e3e147 ("net/smc: transfer fasync_list in case of fallback") leaves the socket's fasync list pointer within a container socket as well. When the latter is destroyed, '__sock_release()' warns about its non-empty fasync list, which is a dangling pointer to previously freed fasync list of an underlying TCP socket. Fix this spurious warning by nullifying fasync list of a container socket. Fixes: 67f562e3e147 ("net/smc: transfer fasync_list in case of fallback") Signed-off-by: Dmitry Antipov --- net/smc/af_smc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index a2cb30af46cb..0f53a5c6fd9d 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -924,6 +924,7 @@ static int smc_switch_to_fallback(struct smc_sock *smc, int reason_code) smc->clcsock->file->private_data = smc->clcsock; smc->clcsock->wq.fasync_list = smc->sk.sk_socket->wq.fasync_list; + smc->sk.sk_socket->wq.fasync_list = NULL; /* There might be some wait entries remaining * in smc sk->sk_wq and they should be woken up