Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1848512lql; Wed, 13 Mar 2024 09:44:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUyIuxBJigiFKKBcNyhPKEHWkTUjnSlnK0RK4gHixs5FGCWPuulDm2ty49jXdp9BkZ6CCRos7C0kLibIzZEsWESMLfrXhWzUOuT/km9pA== X-Google-Smtp-Source: AGHT+IGOT2DMLvzGCusYiKbgvYwrlWxTGEn9qvhyEjezpbOzHU/LzkWmYUFNRhaVKxXzkor7SSE2 X-Received: by 2002:a17:902:bd49:b0:1dc:3e49:677d with SMTP id b9-20020a170902bd4900b001dc3e49677dmr11936055plx.26.1710348261985; Wed, 13 Mar 2024 09:44:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710348261; cv=pass; d=google.com; s=arc-20160816; b=oHMY+4/RL+Ti4VHkHmVO5158fld8MkRqeFXd74+Jq0f/f9jfLvhttqyqvbGlsvEMTh ch0IVT2+vAUVW+z07VsQu1pRv7vS0pdagcSafoLhF18vkjCPCe+JfugqdANk/UC43JHA uALCNUxQB9zgpyRaejlcaU9Jmji93AU6mikyUPFP3Z0tz37mgR1sb2ZbFytvuCRiv/Bv ZEueN5J2Fiq846bKUMvjty1PC6Ct1pO4KNZSCw+CXtUWprZwRbKd7i+IBut2dEAv56dV chFKGoGVNpXZyFyGHlXrXkdzhkcmX1dKOFh9F9eI5CzBVEf3EHKCX1szDk3S4Hd/upXk JYHw== 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=8M36CxP8HqSNu4VU84T41ZovlNn8MAe6WpFAbz02osc=; fh=Uj56ggu7GVoypcvZkwmm+YFiH2R9cDZFdal5Fta1lxQ=; b=O2AuGdoFORafoC927Boui3BacZ8g8zwrJTkTN/cIixFAZStCYsrVOhlEhMgtrpH0nd bo6IjEA1jCb8nHldNP83tzvmT45M/4C+e1pcHW9n0eOvDR0D7N2+8g4ALvxV0O3QWN5p 5h6i4r88tXJvgMmKcO0br1A1fo7fY6eO6hmMk7PjkNTR8+wr022wUKhfgH1jwp/ZVPLR uz2h+leOtn4Bhc+qHbMTFB4CmHs6vbU99WJPnfNpJvjQMiSAQ4brnc4DnILQon5zEs/3 n8EJXxQKZ2gA4zz+PFKdk+p4xv6GqaEo5G9i+QVWePqeODBrXlQfyJclhUqpKkmgpT0N 4pgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UCd0i2hw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101778-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101778-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lm5-20020a170903298500b001dd04d57a22si9584799plb.67.2024.03.13.09.44.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101778-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UCd0i2hw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101778-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101778-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 843C5B23876 for ; Wed, 13 Mar 2024 16:41:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0469627E1; Wed, 13 Mar 2024 16:33:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UCd0i2hw" 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 10FB7626B4; Wed, 13 Mar 2024 16:33:26 +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=1710347607; cv=none; b=TEMZtxi1NJgJwIbEd5yn/ztpztw9tjeMtwPl37/dix276C4abOwtaCCcaUBUEK6Egl/UVc5MxVK2kdfn3M8GOZr7S6Ix47eqhpfkNjCmM2DW9KXQUw74pqzDrr+gWKcxJEuojWD6KDD3eoj4SMO8xHMbRA1tfGMwNClNNlhMjIk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347607; c=relaxed/simple; bh=4EfXQp1V4nsCnZPwQOAsK1SnbhpyNfiFQV00BG3FfSU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RUrT2uu+t6pJrOGgRisA2GBFeIusazjo/yipwz92Ge5rv995k8a0Kdn25ZMO3sYOH56MI4/BBm6vMZNNagdtYWAbBNt13HpTEaqoiIs3JA4ia9Rk5FPOdE4qoUkHP6fkr/3l44PL75zI7fRevHdzCv9WTxVH/KcxFlATeR247C0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UCd0i2hw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D00F7C433B2; Wed, 13 Mar 2024 16:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347606; bh=4EfXQp1V4nsCnZPwQOAsK1SnbhpyNfiFQV00BG3FfSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UCd0i2hwiIzQMMpe5/xepK0BPkGh7QGqPYbEefpbjqtZ1JCJUxYVLik4pdud0XC7S MJhemoSV//WuWFNZ9PxdEKxG8otVJK+BcCahEdd/ElZbehstRfrMIp56t/DdceORW+ ajJ9Tt4XeLXJA9OaD3WBSWXOPtiVRFIGUAq/UlmxaXL8zXK9znrocbdIje7jTQQsoy KjqeGYCWMm6zmcuF66nRskd0arjkROK8KGp3VC6/dCOCMr3zPcWjvmE1xdp1L+ykIV 0qICNvnE0kns5faN8YTZ7xRifFK32TwalPSPBchCwzf7WAq3/ZDwStbkOGRIOcUyD/ 8PxaBHCFiN4jA== 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 6.7 39/61] net/rds: fix WARNING in rds_conn_connect_if_down Date: Wed, 13 Mar 2024 12:32:14 -0400 Message-ID: <20240313163236.613880-40-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163236.613880-1-sashal@kernel.org> References: <20240313163236.613880-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/v6.x/stable-review/patch-6.7.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.7.10-rc1 X-KernelTest-Deadline: 2024-03-15T16:32+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 fba82d36593ad..a4e3c5de998be 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 5e57a1581dc60..2899def23865f 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -1313,12 +1313,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