Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1108286rdb; Fri, 16 Feb 2024 05:47:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUyXytJi4S3rq67elcyEJLwA2mmTtTJDfQPaP460FxTzDgDfBGQnJ37kPb7Ny1wUaE7YrqOXGFkjb83+xe3LWC2kMvwuWxAvCi1Jbfvsw== X-Google-Smtp-Source: AGHT+IE0c7Jw66d+QIbfjZZJAQQROLEVrEcLMvG+TGcJ2RKXBfKAjUXWVzyg3fOX401wUB+63S0t X-Received: by 2002:a05:6358:5914:b0:178:640b:38d1 with SMTP id g20-20020a056358591400b00178640b38d1mr4961790rwf.22.1708091267201; Fri, 16 Feb 2024 05:47:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708091267; cv=pass; d=google.com; s=arc-20160816; b=bDoZLQmaPZrNsSaETfRFXG9PQ4DzIt7+4L0QL8wSxiHAGMRetMq5HM7E1Na10g132u O580IePtzRRkLSggxhPnj4XEMDufQDfXvcky0EJSdJXU2EuzDN2tx6eLBIkfr7wUxp7Q rBipshF4BWWlUEuFkwQmRZbt+Xs3ki7eYcYBHJgofcNVSsSP7dBAFeqUIRPKb1mgvDa4 EqXq9aM65/9BhIJnyNDn5WNogFzIl1w+gvINk2ThW5Yx8RNlWvFULtttJeHfwgItkD+H 8eNnnuM4zKOa97I+YcITqhe+ZVAr8zp5DxC71TGEk/ctFjE50pnhM3yad+EjAel34qdP 0lEA== 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:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=qPIBi6C+A8vJ3oyRznET/i8fe773IKKnMw8e+TueiO0=; fh=MnpLgSGxfZXtTlBK39ngcZTjm3LAy/BAb4vEB/eFJiY=; b=teGzQE5Cuu+mqabf/jQxs8cqdq8UG5LYevFuNQZbHqo6njKp4iPaC4qL3fxTfjoSqL u5CLKxzW74Q9ChVY/cK38Btm0rRwJKUeq98xh7HTUQwPs6oGOZRUMqPgD0tfGv8pF97G dZM51h7xXyWSL1XWIRXN1l1VUXFPpcHCPBoly1t+THywcvolMU8JtFSreR/uDvHCj5Ph 5zV+1U+ueghdM+VRdJh+og0tPiv8TqqgSyAVMuxxynjM/A/f1knynruXc6LprZ35i43e QhxEZOFvwTv3WRLTrpRLOTOAjWWroYFkR4ZXdZWKob0SPorlHABbC+Fu5BHVg6oJMaDL fvtg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rosalinux.ru header.s=1D4BB666-A0F1-11EB-A1A2-F53579C7F503 header.b=UG3raTfE; arc=pass (i=1 spf=pass spfdomain=rosalinux.ru dkim=pass dkdomain=rosalinux.ru dmarc=pass fromdomain=rosalinux.ru); spf=pass (google.com: domain of linux-nfs+bounces-1992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=rosalinux.ru Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s27-20020a63525b000000b005dc491389b1si2951102pgl.679.2024.02.16.05.47.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 05:47:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rosalinux.ru header.s=1D4BB666-A0F1-11EB-A1A2-F53579C7F503 header.b=UG3raTfE; arc=pass (i=1 spf=pass spfdomain=rosalinux.ru dkim=pass dkdomain=rosalinux.ru dmarc=pass fromdomain=rosalinux.ru); spf=pass (google.com: domain of linux-nfs+bounces-1992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=rosalinux.ru 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DB1F528A247 for ; Fri, 16 Feb 2024 13:46:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E2FE12BF0B; Fri, 16 Feb 2024 13:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rosalinux.ru header.i=@rosalinux.ru header.b="UG3raTfE" X-Original-To: linux-nfs@vger.kernel.org Received: from mail.rosalinux.ru (mail.rosalinux.ru [195.19.76.54]) (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 630A612BEB8; Fri, 16 Feb 2024 13:46:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.19.76.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708091193; cv=none; b=g3thNDvllvJ3sKEjfeLFXlWTLz2HsqVUFoV6NC+ZOtJruMmEjSx9tQBR3T+edAQrwLQMM0d6rtQFznWOvlEYPCW0il1qo1LXO6L3axLL4rsHlUO59f8bLpPHWIMjS/ZxkG47FluujbCGLOkvugcc6zQcWVvbrZlMlO7L8XpMo0Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708091193; c=relaxed/simple; bh=yvpJWuM60ZPIcyXXM0SB7Q+oj//ZjvAfrXM/VqE+HUY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=UzyVYmZQNH2/10RJTkoUWskFSFA/ZI3sR/uW43GXweMQky/3l5Xd/+pkR/xzEkeuQ160xMljx3qweLq2xtKzTPKsaxbKJx4rJQYe3AjytVSqKbopnlJ0qMZOS5HYwf582mA3jd+n77wrrBsz69Aou7FKo3dsWbs9ByjbP+1I2co= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rosalinux.ru; spf=pass smtp.mailfrom=rosalinux.ru; dkim=pass (2048-bit key) header.d=rosalinux.ru header.i=@rosalinux.ru header.b=UG3raTfE; arc=none smtp.client-ip=195.19.76.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rosalinux.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rosalinux.ru Received: from localhost (localhost [127.0.0.1]) by mail.rosalinux.ru (Postfix) with ESMTP id DD0DCCFEFE864; Fri, 16 Feb 2024 16:46:23 +0300 (MSK) Received: from mail.rosalinux.ru ([127.0.0.1]) by localhost (mail.rosalinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id leNxKGuf2m42; Fri, 16 Feb 2024 16:46:23 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.rosalinux.ru (Postfix) with ESMTP id AEC77CFEFE867; Fri, 16 Feb 2024 16:46:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rosalinux.ru AEC77CFEFE867 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rosalinux.ru; s=1D4BB666-A0F1-11EB-A1A2-F53579C7F503; t=1708091183; bh=qPIBi6C+A8vJ3oyRznET/i8fe773IKKnMw8e+TueiO0=; h=From:To:Date:Message-Id:MIME-Version; b=UG3raTfEkdR2YHFEaBj4ZpgMn2S7qe6nkNs2LcVRPyWWWJcrusj15hZbMNIFA3fsY 0tncMFqDBQjyFxzgSnCLsprNtLtAN1Sx/zk5mtwz0mPBKAgB55cDUlcxkXGagIAZMv SR1r3Wkr8avxvwuRrKeHl/f/qTWwg3YOTuvyE40lPqaU26oq/YiX5v0e6aOaxH1qu2 kVoz+bYDyX9PiuhicXEp0/iqgxE/p9e2rBs3VXsKDB0my4z3oZmicHnzBHvUzNpGsD E8DNAQNKAd8VfnCusP7va9Jx7Hv3llXF50fN3MDXcr9NerRfWX5jmhc2Olf+ZVM7ij vwCCSkH4V7gaA== X-Virus-Scanned: amavisd-new at rosalinux.ru Received: from mail.rosalinux.ru ([127.0.0.1]) by localhost (mail.rosalinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id C84PylsAgnwt; Fri, 16 Feb 2024 16:46:23 +0300 (MSK) Received: from ubuntu.localdomain (unknown [144.206.93.23]) by mail.rosalinux.ru (Postfix) with ESMTPSA id 4B700CFEFE864; Fri, 16 Feb 2024 16:46:23 +0300 (MSK) From: Aleksandr Burakov To: huck Lever , Jeff Layton Cc: Aleksandr Burakov , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] nfsd: fix memory leak in __cld_pipe_inprogress_downcall() Date: Fri, 16 Feb 2024 16:45:41 +0300 Message-Id: <20240216134541.31577-1-a.burakov@rosalinux.ru> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Dynamic memory, referenced by 'princhash.data' and 'name.data',=20 is allocated by calling function 'memdup_user' and lost=20 at __cld_pipe_inprogress_downcall() function return Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 11a60d159259 ("nfsd: add a "GetVersion" upcall for nfsdcld") Signed-off-by: Aleksandr Burakov --- fs/nfsd/nfs4recover.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 2c060e0b1604..02663484782d 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -850,6 +850,8 @@ __cld_pipe_inprogress_downcall(const struct cld_msg_v= 2 __user *cmsg, kfree(princhash.data); return -EFAULT; } + kfree(name.data); + kfree(princhash.data); return nn->client_tracking_ops->msglen; } return -EFAULT; --=20 2.25.1