From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24C6FC43334 for ; Wed, 8 Jun 2022 17:14:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231176AbiFHROX convert rfc822-to-8bit (ORCPT ); Wed, 8 Jun 2022 13:14:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231421AbiFHROC (ORCPT ); Wed, 8 Jun 2022 13:14:02 -0400 Received: from mail.linux-ng.de (srv.linux-ng.de [IPv6:2a01:4f8:160:92e6::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 40720249323 for ; Wed, 8 Jun 2022 09:59:29 -0700 (PDT) Received: from cloud.linux-ng.de (srv.linux-ng.de [IPv6:2a01:4f8:160:92e6::2]) by mail.linux-ng.de (Postfix) with ESMTPSA id 1A69D841D565 for ; Wed, 8 Jun 2022 18:59:28 +0200 (CEST) MIME-Version: 1.0 Date: Wed, 08 Jun 2022 16:59:28 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT X-Mailer: RainLoop/1.16.0 From: marcel@linux-ng.de Message-ID: Subject: Re: [PATCH 1/3] cifs-utils/svcgssd: Fix use-after-free bug (config variables) To: linux-nfs@vger.kernel.org In-Reply-To: <20220607081909.1216287-1-marcel@linux-ng.de> References: <20220607081909.1216287-1-marcel@linux-ng.de> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi again, argl - just noticed that I described the patches with "cifs-utils" - should be "nfs-utils" of course :-( Sorry for that. Marcel June 7, 2022 10:19 AM, marcel@linux-ng.de wrote: > From: Marcel Ritter > > This patch fixes a bug when trying to set "principal" in /etc/nfs.conf. > Memory gets freed by conf_cleanup() before being used - moving cleanup > code resolves that. > > --- > utils/gssd/svcgssd.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c > index 881207b3..a242b789 100644 > --- a/utils/gssd/svcgssd.c > +++ b/utils/gssd/svcgssd.c > @@ -211,9 +211,6 @@ main(int argc, char *argv[]) > rpc_verbosity = conf_get_num("svcgssd", "RPC-Verbosity", rpc_verbosity); > idmap_verbosity = conf_get_num("svcgssd", "IDMAP-Verbosity", idmap_verbosity); > > - /* We don't need the config anymore */ > - conf_cleanup(); > - > while ((opt = getopt(argc, argv, "fivrnp:")) != -1) { > switch (opt) { > case 'f': > @@ -328,6 +325,9 @@ main(int argc, char *argv[]) > > daemon_ready(); > > + /* We don't need the config anymore */ > + conf_cleanup(); > + > nfs4_init_name_mapping(NULL); /* XXX: should only do this once */ > > rc = event_base_dispatch(evbase); > -- > 2.34.1