Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp86452lqs; Mon, 4 Mar 2024 16:13:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVvzpPnS9DkXBZI0In4w0rOg/wps+me9ruxp01UB+kMW7FdW/amLcWtHRSc45NRmd9Tq/8ZFoTW+asbLMsytZ2Nz+BpnIFQNuVI8oL7IQ== X-Google-Smtp-Source: AGHT+IGbfNbc1rKXeJP44dD2RmTIKYV6kuYEbqHkR85aEQO3FU+zlJKsCDtkEMvH0FvZ6qP/HLZe X-Received: by 2002:ac2:428a:0:b0:513:3309:cc62 with SMTP id m10-20020ac2428a000000b005133309cc62mr190764lfh.47.1709597609347; Mon, 04 Mar 2024 16:13:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709597609; cv=pass; d=google.com; s=arc-20160816; b=EEPJwo3Mp2VBH/g6gKiXeOViOFG6dIik9l3MeDMOzoeEEhsHH4ju+axw0vfDgpNom4 u5pHEzaMFsUlaFpy5JHRZfh0d373HVpcdn4Fm3qHFF33GheUVKIkoIpSA6hemtjp1ymT n3Ae9GZZ7o6uyH6sxMMQVvT63QEcQsmaud/ho4ZWBuE2bjuYUVo2HNvgwCJGB2ErJE+x cVHt0u8e5PuFOzAmrKK+X7C4NmTwPCA4x5WXqHkap/KaPJRYpiZI93uC7lTJMvxeC2DC LmEZe1JvMFIOiW2cGOBWyxe2Cpfmzjyv2aD0r7SpyUzPHN8q16zgsTaF+w0rSdDzDcVu LWUQ== 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=aS+G9OyqYa6igSB8+oaADpXxrUcRmnnV1ukdP5ZUw40=; fh=YtVSUJSZNf1F9swFXRHXl8DIov2MCVc0kIUIj6QxcKk=; b=fd0ZcrMTzBdMgvvda85fCnJouBzknmVuJec3hVW97JWNw7GkbE5LCs3k67HNtj8cph Goj6JdPTuaqMBoOLCQKgriQDD4fT9Q+OrhQrGGqEwC21Th4pOGtnbG/IMF9laUrpBfhb iPi8rbNUA/QY3VugQH34u0TY1Ch/Tp4hVZmKDG4U+S5vjYss9hi+bCwSNGQN6oONT5fA WeOTaWhD/gRSoZIYmANelCDJEuTKNg7FWV8aOIVxZ3kv9+A2wVKBNzt8ticJZFzaxzFy HOXENCagA5NKbQiTSLOGxRYPYdbxEMA7LgNg83glUq148M0Y1APuvuVj7mZhQowijF23 Q5ZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@qq.com header.s=s201512 header.b=a+Q6XbOS; 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-91436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91436-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id nb19-20020a1709071c9300b00a44ee7a12c5si2270823ejc.947.2024.03.04.16.13.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 16:13:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91436-linux.lists.archive=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=@qq.com header.s=s201512 header.b=a+Q6XbOS; 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-91436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91436-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0C5001F2196B for ; Tue, 5 Mar 2024 00:13:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 395D01C06; Tue, 5 Mar 2024 00:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="a+Q6XbOS" Received: from out203-205-251-82.mail.qq.com (out203-205-251-82.mail.qq.com [203.205.251.82]) (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 1757619E; Tue, 5 Mar 2024 00:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.251.82 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709597597; cv=none; b=bNx2zdGj4vFFZqyoHpo0kDpfwILWJqVq6gBuL9MVMOf/lIj74dnv16WENZ7UHUopec9PSEsMxsHSGPIqqF/uEb2iKINmhHVX9igD0Wrzlfn9LxDi60Rrr3P94RhHLHfH7GEqBjA4bSDKgky/FggHE33Ga+FwSJPqupyhStSx6lA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709597597; c=relaxed/simple; bh=dzFbbNoWWlnnW+Er1rHT6ITgFsCk7pt0FjAtfIvHjKA=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=WihBAHJbau/F7rJkFxzo4AENXs5/S0oekVm4dnyYzYRBJh2cQJKoBCyA1Y3Frq4tHJL4nVSo+7NHV7E8QArBCoj5q2yGH0FG+JK+7HWhvMzhqbdQGmFnS5kqAhmDbhwY+mGu3/ciZy/psip/DO7Mxs2jqDeDqNSM5EUJn9PpZK4= 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=a+Q6XbOS; arc=none smtp.client-ip=203.205.251.82 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=1709597592; bh=aS+G9OyqYa6igSB8+oaADpXxrUcRmnnV1ukdP5ZUw40=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=a+Q6XbOSmukfqsk5BhADoTL6N9O8ZPFHokSfvDKx1tRNldLLlBIFRmFUW+19INz5r LP1R+kOjE+W61qukbVNbP7v/3Q/cU7kpUCMuK4g2M3o+u4QPQUBF7hjSbGEU1wCPqJ y9Vx7pgVcCTkaRoXSmkOwpUyNcunl1gknmmqP/hc= Received: from pek-lxu-l1.wrs.com ([111.198.228.140]) by newxmesmtplogicsvrszc5-2.qq.com (NewEsmtp) with SMTP id 347B76D1; Tue, 05 Mar 2024 08:13:07 +0800 X-QQ-mid: xmsmtpt1709597587t8nqmzqn2 Message-ID: X-QQ-XMAILINFO: NkHKfw09D6j8tI04hma5l8nCJ6P9+hd+dsjtTNBrGR4+PCP31iM+3PBXe5KZJB b5SHuN7SjZ9XBHFjoTKhtibV/PchFFHBcufAtaogoWpdjD6SGquoyq0j4dxsr0zt0f6/hWuuhuSg 3MWzUVnEDQ3yl8er60CCTabeSlslvrxEONvGDXt24hMsa4SqHBtDujp/W6ADOx68Xd8mbEanAb0l 7qfLl/VOvuL4Dp+nzHpBch8EG0A5R+WcltBOPLlAAkK3StBpm5Mqy+Y9cqa5+YKCb3myTSDlSqR4 /cOzBBVjiD6snAMAhPPHZztbgj1ndvpex+S5c0b6NVjNg/FPzANrhTchIcrQzngMAOnGkC66QSGb DSzPEvuxm2zBp1GBkQ23xnFyKt6q2T6GKMzFhvtiGy60R6UljIUbmYQ8DAQMSycPyoNjWg8sRaoy pF+RcFc0z4qWzRz0ahXoaT+axeFAzPVUPO6piYErIyVXs5Rq+jLPXjZgA34rT4x2wGAvBLIFrZ8b 0IiC7srFP27ObuxjGV8d7wf71vTs34XuQ0163YQ48UPRUXPRRqLjT56VN9U0u78TYMup0/gMbQPo qNjJvmcEO+gEyhC6NmUt7Onx/nngnE4D7qRWguNrwtTQ4c92B7tdrq3/7VKqq7XjruYd5skp5KZr otompzJBI+7xxvMMDjvNzXI/ZVd1dCC7etP9SZTeJsRKe89pjDbpQCm2Q2wwaghse1QZ/zN/9xb2 E5MKiZ0z8P4KJFBBmNDoULmHH1wf/Mhp4wQoDWTLjRF5OB1KomTyA3kwfdLoUBaeRV4w5vxrBfnT OQoq9XRWROTWBmguSG5kNJmXoopDGDDWm9qQQIMNg5IrqfA70WxUsNdFVrsGEMY0Da0pjuvQ8gQr Jt6Nc0ULbQJZwXTQTmT095ofHs+tsmMeYgqb+NUbbSV4tXgAM/eWsVtnw0y0ZlR//WY/R6InXcwW PhIFFYIupNRfIh5gNmhVPrxVeca01g06y7tJnHfdI= X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= From: Edward Adam Davis To: horms@kernel.org Cc: allison.henderson@oracle.com, davem@davemloft.net, eadavis@qq.com, 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, syzbot+d4faee732755bba9838e@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com Subject: [PATCH V2] net/rds: fix WARNING in rds_conn_connect_if_down Date: Tue, 5 Mar 2024 08:13:08 +0800 X-OQ-MSGID: <20240305001307.2240958-2-eadavis@qq.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304170707.GJ403078@kernel.org> References: <20240304170707.GJ403078@kernel.org> 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