Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6976202rdb; Fri, 15 Dec 2023 13:49:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKvYWAWpT5LXp7Btxrarnq5yYFflPe97LydKD4CxZKv4sHyWh890+4kV1MCZqqcdum0aE9 X-Received: by 2002:a05:600c:230b:b0:40c:2788:28f8 with SMTP id 11-20020a05600c230b00b0040c278828f8mr2798870wmo.94.1702676988088; Fri, 15 Dec 2023 13:49:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702676988; cv=none; d=google.com; s=arc-20160816; b=z5N80SW0nRlIA0LHdRE7/TT1bNRa5NEFtqtlRhI+rPXCBMChGGVXMsIUBMzMtug3bH 17mGEvQ0/hnvzoEWOrkyLGovgeHD8tF9xiDop2no7dziNsojjr9kPaRSuG3uhc2yNbhn 1+19nrdD6D/TaW+pyTE9pfZFDes5RHnLD/hYNNlw7d/ZhJL2qboHezpgqs0yQ4H8w6yy QTu3JhPuzWo9KhIA8/QdzClf3oozjtTGkmzI3d9WZPky/oW6pGvg+zAjWlu6BBPwaaxu D9VxJgmutWpPF668nlhMylLIuXHSA4SjKRGYAtdWYXF+zt3ECZ/lbwWsPXk34GL78VUS rTGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=FMO8+QZuPvsTjEiPng0xTvGLmJ61p5PwJT51KIIg2nI=; fh=9WVYkZZswu7tyxO2G/iFh5l6I+hfRv2+m7yU+1XOfCw=; b=AjZnHZZA6Andzq1VzUD6Dgujc8pRn+V7poRaZCBEGDFxNxHKIssInkaV+Wg9Hpsg6h i/an6JBxoGfchKcigX5M8dgVEYaH6jH4a4bB3o1bRSdk6Z5xSOlcRJbg0+IGsbWhRAfY iRN72Ghwy5e9shHwtAMw4TXrPISCXgXHauw+Xi2LXOTSh1bWAl4IeTyER3zJbq16nT5S 07ZDr56tgWkVvognmSGgpNmI+9oEFIsT6mm/lUYVzPYh1nXnW+BPLvhWtVl+gpc3+0f5 /F4GXLxvaJ0q0TDdmZSLimBixdadd2P1bTSQ0kPQFlPIvH7B5115TfJMci51X6tZ4ZuK WBbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b="Z7/gUHEs"; spf=pass (google.com: domain of linux-nfs+bounces-656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-656-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.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 j25-20020a170906051900b00a1e095c4e75si7469343eja.303.2023.12.15.13.49.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 13:49:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-656-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=@oracle.com header.s=corp-2023-11-20 header.b="Z7/gUHEs"; spf=pass (google.com: domain of linux-nfs+bounces-656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-656-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.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 BF42A1F21485 for ; Fri, 15 Dec 2023 21:49:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4428A48CE8; Fri, 15 Dec 2023 21:49:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Z7/gUHEs" X-Original-To: linux-nfs@vger.kernel.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (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 C62F74879B for ; Fri, 15 Dec 2023 21:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFK86xU018600; Fri, 15 Dec 2023 21:47:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=FMO8+QZuPvsTjEiPng0xTvGLmJ61p5PwJT51KIIg2nI=; b=Z7/gUHEsad55QvHX33FCuG7p49/OycA7oBcrgVNE82hsuWoA09zNV8+JpMRHM7N9R+PU kw6BKml9f9JsDSiz8CTp57uS6CLoYucKefVn7GEksie18sbyQVaDXAz5qf9kGK9MK7Qo /F5FyILlQyUpaiLzNb5/y1sWXRr0j5S9onA8hCOy2S3G3Q8mly+V/yAodGeMIizHRpJ+ ChYp273Xjl/pbGP7+VVw8BXuBw7kdb8E1WAyVThIFj7GE1zXVvYL2yMUpOu8JU2BvPEt tTKKZtv7bPg31HFPdzX1bWuGBC2rqEhq2xge/szG1rfQ7whf6HmEl6fJbj4+01EhoWG2 uA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3uwfrrvsgg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Dec 2023 21:47:30 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFK43Dc029861; Fri, 15 Dec 2023 21:47:29 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3uvepchqng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Dec 2023 21:47:29 +0000 Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BFLlSH2022773; Fri, 15 Dec 2023 21:47:29 GMT Received: from ca-common-hq.us.oracle.com (ca-common-hq.us.oracle.com [10.211.9.209]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3uvepchqn0-2; Fri, 15 Dec 2023 21:47:29 +0000 From: Dai Ngo To: chuck.lever@oracle.com, jlayton@kernel.org Cc: linux-nfs@vger.kernel.org, linux-nfs@stwm.de Subject: [PATCH 1/3 v2] SUNRPC: remove printk when back channel request not found Date: Fri, 15 Dec 2023 13:47:15 -0800 Message-Id: <1702676837-31320-2-git-send-email-dai.ngo@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1702676837-31320-1-git-send-email-dai.ngo@oracle.com> References: <1702676837-31320-1-git-send-email-dai.ngo@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-15_10,2023-12-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 spamscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312150152 X-Proofpoint-GUID: oTOCS_UMH5XW1xZsPD67KVsPd9pOwGNE X-Proofpoint-ORIG-GUID: oTOCS_UMH5XW1xZsPD67KVsPd9pOwGNE Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: If the client interface is down, or there is a network partition between the client and server, that prevents the callback request to reach the client TCP on the server will keep re-transmitting the callback for about ~9 minutes before giving up and closes the connection. If the connection between the client and the server is re-established before the connection is closed and after the callback timed out (9 secs) then the re-transmitted callback request will arrive at the client. When the server receives the reply of the callback, receive_cb_reply prints the "Got unrecognized reply..." message in the system log since the callback request was already removed from the server xprt's recv_queue. Even though this scenario has no effect on the server operation, a malicious client can take advantage of this behavior and send thousand of callback replies with random XIDs to fill up the server's system log. Signed-off-by: Dai Ngo --- net/sunrpc/svcsock.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 998687421fa6..3e89dc0afbef 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1060,7 +1060,7 @@ static int receive_cb_reply(struct svc_sock *svsk, struct svc_rqst *rqstp) spin_lock(&bc_xprt->queue_lock); req = xprt_lookup_rqst(bc_xprt, xid); if (!req) - goto unlock_notfound; + goto unlock_eagain; memcpy(&req->rq_private_buf, &req->rq_rcv_buf, sizeof(struct xdr_buf)); /* @@ -1077,12 +1077,6 @@ static int receive_cb_reply(struct svc_sock *svsk, struct svc_rqst *rqstp) rqstp->rq_arg.len = 0; spin_unlock(&bc_xprt->queue_lock); return 0; -unlock_notfound: - printk(KERN_NOTICE - "%s: Got unrecognized reply: " - "calldir 0x%x xpt_bc_xprt %p xid %08x\n", - __func__, ntohl(calldir), - bc_xprt, ntohl(xid)); unlock_eagain: spin_unlock(&bc_xprt->queue_lock); return -EAGAIN; -- 2.39.3