From patchwork Thu Sep 9 05:43:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 12482533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6662C433EF for ; Thu, 9 Sep 2021 05:43:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CAAB660C51 for ; Thu, 9 Sep 2021 05:43:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350863AbhIIFoV (ORCPT ); Thu, 9 Sep 2021 01:44:21 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:34396 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350838AbhIIFoT (ORCPT ); Thu, 9 Sep 2021 01:44:19 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 06E58201A7; Thu, 9 Sep 2021 05:43:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1631166190; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=reJRJoTtGBrdy2xrV5Q3+NziIUzCA4EQboTh9IQRFao=; b=gAaviq446DiFinmIuK9IyirCkK6mc/28d6FOGzFvEj5KI44bMyJvBhoa2989Aix9Nq6w4P rE4WP5UiprUvkRSrpfodfquqA0Pg1g342GIwo++SRNxX5OzAkfTjmfBT7GBl+ciivNngeM XyBzzoPfTdHWiaH+5USMpUKKZx15TnY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1631166190; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=reJRJoTtGBrdy2xrV5Q3+NziIUzCA4EQboTh9IQRFao=; b=+HfnsZyDd7PREgnBLrif6AEfoPA5tAK8Y83g965wkDzds22SRWLE0x1H7FpceIA4s90qNJ BQlRatWoW/SJRHAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BD3D913A60; Thu, 9 Sep 2021 05:43:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xuJ/HeyeOWH9cwAAMHmgww (envelope-from ); Thu, 09 Sep 2021 05:43:08 +0000 MIME-Version: 1.0 From: "NeilBrown" To: "Steve Dickson" Cc: "Linux NFS Mailing list" Subject: [PATCH] gssd: fix crash in debug message. In-reply-to: <627209c3-21dd-312e-c2dc-cc810108f7d1@redhat.com> References: <20210610150825.396565-1-steved@redhat.com>, <627209c3-21dd-312e-c2dc-cc810108f7d1@redhat.com> Date: Thu, 09 Sep 2021 15:43:05 +1000 Message-id: <163116618506.12570.5744024691858636230@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org A recent cleanup of debug messages added func and tid format specifiers to a debug message (when full hostname was different), but the func name and tid were NOT added as arguments. Consequently there weren't enough args, random bytes of the stack were interpreted as a pointer, and rpc.gssd crashed (when -v was specified). Fixes: b538862a5135 ("gssd: Cleaned up debug messages") Signed-off-by: NeilBrown Reviewed-by: Petr Vorel --- utils/gssd/krb5_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c index 6d059f332881..e3f270e948ac 100644 --- a/utils/gssd/krb5_util.c +++ b/utils/gssd/krb5_util.c @@ -673,8 +673,8 @@ get_full_hostname(const char *inhost, char *outhost, int outhostlen) *c = tolower(*c); if (get_verbosity() && strcmp(inhost, outhost)) - printerr(1, "%s(0x%0lx): inhost '%s' different than outhost'%s'\n", - inhost, outhost); + printerr(1, "%s(0x%0lx): inhost '%s' different than outhost '%s'\n", + __func__, tid, inhost, outhost); retval = 0; out: