Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1162794lqg; Sat, 2 Mar 2024 20:03:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUD5SRL0wHf5NQfKAyjr4kuKDB++soVT7smGCHriaKkx/VSTcKX4MpvUZExghlVmcNQGt09zsslBXUB0iIwkoB+3hvZiUq3/Jgdv4ZXMw== X-Google-Smtp-Source: AGHT+IGFCQ1NgoeIPgULArn9ZI9/D5+880WpJA8FzgVSKTqV/a9DYgsA2fxwUynGeFAnT6+LR5XL X-Received: by 2002:a05:620a:ec2:b0:787:f16b:e4a with SMTP id x2-20020a05620a0ec200b00787f16b0e4amr6153168qkm.42.1709438602650; Sat, 02 Mar 2024 20:03:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709438602; cv=pass; d=google.com; s=arc-20160816; b=RUAbXYmY1Auh+ICFd9+gl8dPenAXMkxvOJ6fBKN1tTv2xCVge1GK7nR9eFOpFH084w 9Bxfx7uE8H7F7gwbx6C2OcE2fylURSVHqltSY+UaL2WlxfSMCqQuPKpD/ZCv7tRe3dRb DOw9lPuoCmEK+h0jkx8YYfdHb7MlXl88MGlsGQpdr/zgyDYwqeQV/3YqKqFzi/p+EgYO xbPAnDH89SfHvhAD7gVmrIdU/NiFqj9HjvqRp1m2kdTm6n6+3kpT2vSRqC66siR2j2Ag bMyRKd+pMfLHoygSqFQb6C41B8w16F+FDXj+rlz7AaGjjedI52wB0OXXk6We4Cdb+jCl 4eew== 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:date :subject:cc:to:from:message-id:dkim-signature; bh=5dDVBe3HuaAOncRzOnzyWpaD0IWT/pNJgquP/aC+9ec=; fh=wVRtQ+G8rnY9VfhT+6rJcaQ0qJENE9Z7uD6UR7I8nL8=; b=CvVmFGBcXYt3GcbFIVbx5A3P8yWgC3zZfhadJKhJF+L1vqswlNBWti229OAi7MG6Gb qEVYiqWcmC3Pv6u9N7/xzjybhYDqvG6ncPAyjt5owGz954R5zE+wsQhCWeYadP0SIqFY btuchu3XtnlyTLuiZCxddZP5jfSzYkjIXGxXDp+qGYSIKOaKncXIu6CBFJ2QMzGqmtRF epfUeq3OqLgzO7fMml5FMc/iIdPUKCF1LCzxZkhe+8P2ufSW2qOH8GbLueYuG3yZeW0o VKfmqK+O0nL/WMNnBUrKc592nTszqj5W+xa1HomZZBJTZSO57/5iVmOTYwdVBw/Q4hrH CQNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@qq.com header.s=s201512 header.b=YRJwV5+I; arc=pass (i=1 spf=pass spfdomain=qq.com dkim=pass dkdomain=qq.com dmarc=pass fromdomain=qq.com); spf=pass (google.com: domain of linux-kernel+bounces-89650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d26-20020a05620a137a00b00787b7e3e78asi6896657qkl.321.2024.03.02.20.03.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 20:03:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89650-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=@qq.com header.s=s201512 header.b=YRJwV5+I; arc=pass (i=1 spf=pass spfdomain=qq.com dkim=pass dkdomain=qq.com dmarc=pass fromdomain=qq.com); spf=pass (google.com: domain of linux-kernel+bounces-89650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com 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 61A371C2101D for ; Sun, 3 Mar 2024 04:03:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C42E7499; Sun, 3 Mar 2024 04:03:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="YRJwV5+I" Received: from out203-205-221-173.mail.qq.com (out203-205-221-173.mail.qq.com [203.205.221.173]) (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 15E797F; Sun, 3 Mar 2024 04:03:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709438591; cv=none; b=J4V1s+hyP6CUeY0OzLi84k76YiaN/lWERxe35ttluv0VsKEvL7gNW1B02XLs0avACZMm4plRO4JhU9ieyySiJMYp1XDYU0bSMLRa51viCYVhF5c/TErcdDQhGYex040B2fr1mue2OzZfOoM7GDzjPYlsLaUdPctP0jHOlUvLZFs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709438591; c=relaxed/simple; bh=Bh7Ou7LNgE3RsAKDPXarLzfNkzyOUV0mLT1ZekkctT4=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=KaVihlUCJflJJ+Mk4MBNdtxQi+M46B1dxJdqj1w25AE94eTg3M7UD75dQnYWIxagjyMpiujJTV1vvvrorUnivxCdgXCwgyenRask3ouS80FnvYASV51cJiQCTHgZqdXCj/65/wWjW29wkezL3eTQWSUBvBA4YR55C7LyMLqkdeQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com; spf=pass smtp.mailfrom=qq.com; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b=YRJwV5+I; arc=none smtp.client-ip=203.205.221.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1709438279; bh=5dDVBe3HuaAOncRzOnzyWpaD0IWT/pNJgquP/aC+9ec=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YRJwV5+IZigCcYfmkfOk+xNBw3b7b0xDO/kAl1ztQD73Ru33wBkitAQHHOowVkUVu XUhs0bFgcS0LDC8Kg9P/yUS5ViMxtJ0u21Rn/z7LhH/PXNNuxgNGZi/UUPcH9zeUgY faCY7S3Ukv8MPOK4yuR/vXwlp3KITVOhsLFgzoto= Received: from pek-lxu-l1.wrs.com ([111.198.228.140]) by newxmesmtplogicsvrszb9-0.qq.com (NewEsmtp) with SMTP id E7807020; Sun, 03 Mar 2024 11:57:56 +0800 X-QQ-mid: xmsmtpt1709438276tbcyekehu Message-ID: X-QQ-XMAILINFO: Nq1uWKlIb9DMAoxRSw7gHe9zvgZW9iTWgoA6Jqvu26fsyiuvGY1WoQ6ANc2rtQ 6KGvuvN+EYtq3DQR8xt7mrLrivvfqqt4PJPF37WMgly2OES3LiOZI2ZNrCQFOuGRqxl3YywurdJN U01yhfiiG/pFqhp1x/e5V9UpCN8bA8/bz/aFdiz7OsDBqOWRZ2o835ntuaV3AcbdqUsm6aVpWT0Z LrFEEvrf+Nd571dnl5ZRDyzvNUxYDn9+mT9lNXdq4nrVtk7kofEE03QVBXnyy3XJ3CWXIN50Gg6g GRNV6YdNG7NeGEu8l+++PcFi11Wi3TeVUw0gtV0NAxjpgoJ+DCFvaCEwA2BMapKIE+GebKolK/K6 unkgN8jwIGH13xG7ji03MhhBVdq2jy83Msu7XOPwMet0BFLPVDUemOLCDPn3nbZUgZxmHKspoUAa JgV2KO7Iye03/qw7gNFkAap71SdO+52Q3wAwLuHmtRx50msHjoJuJpWjRvarLh4xVFmzyi8kyHBW h7Zd1EBXMImTAhPaaLxMKNdQ6fSAXOLQL8ZkK0799nBOy0T8AySFnqD+kh2a4b+TlHPRkCpxGvGe uvH9MdfUdNcTXuOQ/iQhydERRPyeu4Ul4j4jpqt4596620ns+j/+Afyay+BZOWNlmj9gXEJe6e/v 5yW1IfHWQS75ty41fENDrvtoU3g3ie1HB2sTbB7SDDoEBczrAkopo/Uo7hDpOTD9Bv5slDchs2XK 8lYFtJGgGNvGZ9FjolmU+I6GWE6G9ioXMdVVf37ewrkx37wL4q1RE8slxTzl0T8ZWhDQPJSUmtj4 eA2aC9z+Fwge/75jr30+I5h5Mw8EKH/l56hJqmDV7c5UPesQdF4qXuBtAU7mz0eo6tzSZ5NwgxbL 2fCvU7kCzlr/fMYx7H4n6zG4KlBCtNiopMUc5nAvsVriqz+1/KTUhquOVjM3Ub0A5nAL4eBUv74m Lcew8tpGo= X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= From: Edward Adam Davis To: syzbot+d4faee732755bba9838e@syzkaller.appspotmail.com Cc: allison.henderson@oracle.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, rds-devel@oss.oracle.com, santosh.shilimkar@oracle.com, syzkaller-bugs@googlegroups.com Subject: [PATCH] net/rds: fix WARNING in rds_conn_connect_if_down Date: Sun, 3 Mar 2024 11:57:56 +0800 X-OQ-MSGID: <20240303035755.8320-2-eadavis@qq.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <000000000000c0550506125e4118@google.com> References: <000000000000c0550506125e4118@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 fba82d36593a..a4e3c5de998b 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 5e57a1581dc6..fa1640628b2f 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