Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp462855rdb; Mon, 15 Jan 2024 03:09:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsrBQGAXOsu5IlQTRkz1UvOktN49IbRW2e/tUiwvoqXHAonMQm3G2gldp9edkwG9L3AfAp X-Received: by 2002:aa7:d8d7:0:b0:559:4586:656b with SMTP id k23-20020aa7d8d7000000b005594586656bmr697275eds.55.1705316965076; Mon, 15 Jan 2024 03:09:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705316965; cv=none; d=google.com; s=arc-20160816; b=KWm/IajmA449GaBLPSz3Sk0RZu6H2D4LZwX+f4l01Ly4E++IbF0CVzAIhy5qS7ms0b CGuF11kT6mqjh/vy7eFI8eu3KICmoP5V3OizmpYCyqfHA55Z1Ib6ugEQjWMATUn4O1aN wJFCkYPykspQOOUM9sa9rQPMljGwZfY0Rd/d0EwrVTyBxz4QQlVfWA1o7s8KxD6gQ0DO unegzO4Cb91zc+JzEq88+UXHdyqojv4uFpeuy/4VNqkyeFlU46PXCqlcTYahn/jUT6hI DONm0P874yQieWqqVmG5glx263JQf13WWYGa1HJ0/bNGie1FVYVR1HEeBAGhQZCPy6no 1mJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aIkaQRC9dYgrN5EQPOx9WDglyjPif5H2ojOPVlV1i28=; fh=Sd5TBnIKm8glSOYITS4CJzY20ybn8TYGrVV32+KKQgU=; b=l0Z0HCraPbMFJrma1jbhiVOECfMZw4cqEcGnDRexSzawfQKVjhKOH2Ps4y1LzxO1Jw 1IH2MylG2ZA9JSJnFIx1eppuePGuO7VoHvt3wQXddHZwuSxhtfzMcSekvVlWBraa5nLd 2fh5h955ftOEKnTceWee5xs5YiS5km1KLTQrUV3IN6SuLpxWQNnRpT5+Oi7urfpuMyy/ lgtOuydj0jnukCQd6aji9lz21Qw5hrczUlKsL4rEN6TJZ2l0L2VUNLNCAXbomBgSJXNA SHa8w102FaF6OHV5w7cnnXgaD86wewkDiFei4AWhDi6q1ICQqiMbCGrg4JVJpHs2t1/Y vA+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fIxX8Hd5; spf=pass (google.com: domain of linux-nfs+bounces-1084-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1084-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id by4-20020a0564021b0400b005588a9404b5si3764051edb.458.2024.01.15.03.09.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 03:09:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1084-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=@kernel.org header.s=k20201202 header.b=fIxX8Hd5; spf=pass (google.com: domain of linux-nfs+bounces-1084-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1084-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 am.mirrors.kernel.org (Postfix) with ESMTPS id CCCB71F22225 for ; Mon, 15 Jan 2024 11:09:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 222642C683; Mon, 15 Jan 2024 11:09:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fIxX8Hd5" X-Original-To: linux-nfs@vger.kernel.org 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 F1A042BB06; Mon, 15 Jan 2024 11:09:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7EDEC433C7; Mon, 15 Jan 2024 11:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705316951; bh=u5h2QQBP6fhgiKwHjsHHAv7nLPOgzXKmoQfDD5Bd5Xg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fIxX8Hd5rBfP0r5teoC/V9pf4fzdq1XLqNdrl71NceoOqWpFHJAjRLmIPEdW3+kkN EnP5GzQYBMRQWvhU8a9N0RR8oXnsdF5ySK3JbNcPy9gjIb+ogxD/E9mwT44Oms/b5c +EZ5tyhBRvanH4yFfKXN6NCIUl+Oc+agV6Iw7G9HwC7lxWAyJp4hgG5S8EE5wWGDdo o3bf7StzVZcQcUzYX3qMaD7UUWrIz1PVavZDcuFlGaw/xVcgYf5ZiZyiiQkYJtDj3M G2kRomH8XW/tjz/3ZCvzwpXqNMCwGb2DXXKfY5ChqTjPrNviNvHH0ZvToTC3oSuRkz aGd1z/6cZdvBg== Date: Mon, 15 Jan 2024 11:09:05 +0000 From: Simon Horman To: Zhipeng Lu Cc: Chuck Lever , Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Trond Myklebust , Anna Schumaker , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simo Sorce , Steve Dickson , Kevin Coffman , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [v2] SUNRPC: fix a memleak in gss_import_v2_context Message-ID: <20240115110905.GR392144@kernel.org> References: <20240112084540.3729001-1-alexious@zju.edu.cn> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240112084540.3729001-1-alexious@zju.edu.cn> On Fri, Jan 12, 2024 at 04:45:38PM +0800, Zhipeng Lu wrote: > The ctx->mech_used.data allocated by kmemdup is not freed in neither > gss_import_v2_context nor it only caller radeon_driver_open_kms. Should radeon_driver_open_kms be gss_krb5_import_sec_context? Also, perhaps it is useful to write something like this: ... gss_krb5_import_sec_context, which frees ctx on error. > Thus, this patch reform the last call of gss_import_v2_context to the > gss_krb5_import_ctx_v2, preventing the memleak while keepping the return > formation. > > Fixes: 47d848077629 ("gss_krb5: handle new context format from gssd") > Signed-off-by: Zhipeng Lu Hi Zhipeng Lu, Other than the comment above, I agree with your analysis. And that although the problem has changed form slightly, it was originally introduced by the cited commit. I also agree that your fix. ...