Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1873711lql; Wed, 13 Mar 2024 10:24:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUh/9NA2Rc3sY1tcBOWDlSbVlUoi4sEkCv9FZl6g+Qfu2BRXCOpSYq04pkmIPbHT+RQRG9B0YrFhETQUppnEjMrf/9IAKBHUytOs1MHPQ== X-Google-Smtp-Source: AGHT+IH//QmBnPdHU6kxFSONkupzt5ELjMdWmynEZCjJl4ECi+9Z9UKYqjRNYuqDvpYIK2N69jmG X-Received: by 2002:a05:620a:2983:b0:788:709d:93cb with SMTP id r3-20020a05620a298300b00788709d93cbmr619446qkp.51.1710350649512; Wed, 13 Mar 2024 10:24:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350649; cv=pass; d=google.com; s=arc-20160816; b=jMDDROrx+I43v3BOsQ8muDWAsUvWwdFnVt3KnI8/t7zCEkchdjxRQhvJBZMlwL9JTE O7e6oi1apnmK2q3q6vbmMxipclofKzOdX+L1vKEV5I2Vd6I0Z6VvXTYezQp0GWOJL7bT Qj8brV3fEiYsFtiVWm0u7akPsDcsz1ruPKyUkHkKO36hng9rMRrERko5FNPey7n4fCyS k9JopelXrw1wrSXGK87zhgQ/N87K1EbzFx1mjQcz+88yFIsXwlDYoUTwKpFvJ0dJvpCv cu63E1L6af2NYHaAaDM6ntFw/etKkjtkj+jwCqR92zG8DZvWIoF6h9XJHJPjv4MYVb8A DSmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Lbkq2mU+NqA1Bf6T2qA99vm0vxwiryhC3cul8KSwvJI=; fh=Uj56ggu7GVoypcvZkwmm+YFiH2R9cDZFdal5Fta1lxQ=; b=KaO1IpsjKzmXFZ5grGrxVihWekm5Zg1r8o9H1uXh0FrnZur4wgNwNzbcuFvGHchSYw pIQaBkUheJt2t5XZ3VO6hKvM8l31Jly3x89vIaf+paggPRtlhIFMwRMUFmavIGmn4vWk lJZfXMMNb0mmtMkA5GRVKxs9WfE5ZSldcLtNnLOVdpOaRZR7w/A9cRmhqROOpAxovQFJ KZ//uFN7zQZ3nzg8sxeQ/1Su/p/C7dbokYsFqnX6IIqVjVxqSU8Kd9la/F/fSqC3sYm9 LXuga63Z6TVR955g0/AHPfk+brUgBAVdUv+qPuANfa+LdIuIfl+C+NvmJIjdGslNm9ys Pq1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jZlyfmtw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101952-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101952-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p25-20020a05620a113900b007887833a900si4500743qkk.635.2024.03.13.10.24.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:24:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101952-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jZlyfmtw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101952-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101952-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2AA171C21BC6 for ; Wed, 13 Mar 2024 17:24:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A3E6139598; Wed, 13 Mar 2024 16:42:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jZlyfmtw" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 36588139579; Wed, 13 Mar 2024 16:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348161; cv=none; b=tz+rEdHT1lA8b+kDkv+YdXlM4Dvehg02qkEb3PToa7EJRb8U7GhYsSbj/zLDLuD0VhJVMWai4fyOPowM/9z8sjI6zVcJCaPvf5TwPRki+Xw6SxCLBF+/M9P2mBHLTE1IuOckp+j09o1bbAD+6YU1yNzYvneGhcN3mrtD2q5aaqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348161; c=relaxed/simple; bh=BJMqZs3HypZYIgRRS3ZNRgnZRiqh9LAfOakZLpvame4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rMzGBxWx8ISuiOlA1RJbchNN8QdmfeXCOT533KlySW4HVkocOsBK20yXrWs4IFN1SZShpgomhNhx54dLkd++5SvXPlBTZ75N1MQFF72WrfvAaBTD47kysFHiFFdFhMLcsPKt9n2FwbEj1E27N/cbASb3mzwSW58S+cznfR/yFuw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jZlyfmtw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4508C433C7; Wed, 13 Mar 2024 16:42:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348160; bh=BJMqZs3HypZYIgRRS3ZNRgnZRiqh9LAfOakZLpvame4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jZlyfmtwrRtLfiCbXW/8pnac+o21uKiJ0pt0HJCKRbC43Dhm+RjTE9ESOxGpWOOvL YWFqeC6jd67kk1bTXLv/qEOlb3IMYeUaWFBERcboJGH8FJ6OOTplhclObDbPHDnZoI yTJDoq1bNIiFau+ja6sqxN9h3YC6OfuIapTYDIKtMtYCrtfXTcuqJkw4D9AquU9qPb MR6QFMcuUc17C2mhG50x9EiW/kk8JE5prMHPFrpqabFEdK1SlrypnLsynD6cnChN6b LLW27v0e07c/SzUyByYfekNBpaX7dxvVbjWk1Id2SCcK+deaNOpQ8cJpBkMnVu50fr uZsjM+FDsOSow== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Edward Adam Davis , syzbot+d4faee732755bba9838e@syzkaller.appspotmail.com, "David S . Miller" , Sasha Levin Subject: [PATCH 5.15 12/76] net/rds: fix WARNING in rds_conn_connect_if_down Date: Wed, 13 Mar 2024 12:41:19 -0400 Message-ID: <20240313164223.615640-13-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313164223.615640-1-sashal@kernel.org> References: <20240313164223.615640-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.152-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.15.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.15.152-rc1 X-KernelTest-Deadline: 2024-03-15T16:42+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Edward Adam Davis [ Upstream commit c055fc00c07be1f0df7375ab0036cebd1106ed38 ] If connection isn't established yet, get_mr() will fail, trigger connection after get_mr(). Fixes: 584a8279a44a ("RDS: RDMA: return appropriate error on rdma map failures") Reported-and-tested-by: syzbot+d4faee732755bba9838e@syzkaller.appspotmail.com Signed-off-by: Edward Adam Davis Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/rds/rdma.c | 3 +++ net/rds/send.c | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 6f1a50d50d06d..c29c7a59f2053 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -301,6 +301,9 @@ static int __rds_rdma_map(struct rds_sock *rs, struct rds_get_mr_args *args, kfree(sg); } ret = PTR_ERR(trans_private); + /* Trigger connection so that its ready for the next retry */ + if (ret == -ENODEV) + rds_conn_connect_if_down(cp->cp_conn); goto out; } diff --git a/net/rds/send.c b/net/rds/send.c index 53444397de669..d6462d1471c14 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -1314,12 +1314,8 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len) /* Parse any control messages the user may have included. */ ret = rds_cmsg_send(rs, rm, msg, &allocated_mr, &vct); - if (ret) { - /* Trigger connection so that its ready for the next retry */ - if (ret == -EAGAIN) - rds_conn_connect_if_down(conn); + if (ret) goto out; - } if (rm->rdma.op_active && !conn->c_trans->xmit_rdma) { printk_ratelimited(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n", -- 2.43.0