Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp260529lqj; Wed, 10 Apr 2024 09:35:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUA/UZNTyCRupguS/dhPd8Ptzyffl/PWk4oMDX4Nv0QXMp1o9Kc0j3IPBQwxRGTUXWgLKqSjoLxLvDFZCe4o9J0ZtQZYyn7UcjerCautA== X-Google-Smtp-Source: AGHT+IEk9myPcndyUzDrRcc3ojoVv9pprZmnOsRYC+U7kqV2dfPs8qCo06hY9LTFtw3HUtl9a85P X-Received: by 2002:a05:6214:2a47:b0:699:2e62:4115 with SMTP id jf7-20020a0562142a4700b006992e624115mr2736668qvb.23.1712766942022; Wed, 10 Apr 2024 09:35:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712766942; cv=pass; d=google.com; s=arc-20160816; b=f1B3oTxBpzgipkb2/Jw5UDy3umdsGpfxzsKpLfec/obrUZNt5rLS+6EviBR9/z/yAp ACZtWPJaFaHHJTMCgnOhrwmiIYh4cxAYfD9FizFTvyYPFEusGe/JJ7Oc+j5FIMpu5T1F Yh4hGirGmUVcpk8/RRQ1muCwZskT85zA0qmfi0DXD35d/5cuZLoQHs5e5pZhetXcDPUs PO+vgvb6xuYLZEqRK8fFlPsJhVN6UhxvtCxxxjIembuHMtF+PJrP+IU2mVpx4EMB0trw FJeiCD4s++of6f/SyDPJvWoJlr0RvAR7aj2LhabBW8Z9YqRUDGPer6Q0HGeEvW7kVXor Vw0A== 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:subject:cc:to:from :date; bh=zcjKkumpxYZ3jXdLskTXzrwJ8BL0UuRbq3D4CtGEp4M=; fh=WnPypC/3yvDcKZxVsForw3SGV7wTSilHvyONDH4ImCM=; b=uX/2J5Y0JyXQ578AeO8GaxnEN3F5GuMbsD0mK7/pOJZP7hf29BxGmpp8pKQWH7mZL6 2Pa++np45LHOxAnPVQGZzWKLv82lFBrMvnVrXbARMq3ctV+dZqTjJXV+SL99kch+qq3U utxzxmof38szPLCZgnN7rlP10jeu0bdD9HbHX9ES60MYPZCXQbLMXPJNzIaCRrpqTtep l9b2LcOCpHJLK/kp8KFGQHAUwFYwuaW9m6fQUhPJIEZ0loft64humCsYady2gMSPG7aZ 4kpf/3da+6ftbpkKiuFaSjSxYIQZiHj0UHWPXiXo5XBaKs8Chkl2hWZq4FNdKWrB/s9N DeGA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-nfs+bounces-2745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2745-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pr6-20020a056214140600b006993c51102dsi1219122qvb.290.2024.04.10.09.35.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 09:35:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-nfs+bounces-2745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2745-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B96D71C21173 for ; Wed, 10 Apr 2024 16:35:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B262C1779A9; Wed, 10 Apr 2024 16:35:38 +0000 (UTC) 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 93EA315444A; Wed, 10 Apr 2024 16:35:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712766938; cv=none; b=IygiXPSvFsPGlHqzLaEJeOm5Mh2kTmqi/2uoCgfPThmP4YbIWRfGB8PaO9oLxCzxy2gHq+GuffSIVuMqWVoVVd5ubj1vidw5+jbqHK7sFkOWmLZKhn5dgTgpZdQQwMnqWFKn1ESygx1yfPI+LiNfHgLoW5caHhsQqEQMA0gowCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712766938; c=relaxed/simple; bh=Wr2v7oPzKVYPKYtdpNS5Yk5ayJokTx7rSACaIZwFBe0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=lOQvsLo6u/r6Bet6/BUEEgGqhzeXqY4wcfO+lvV2A5kIQu5ITtXMj3uZcTSTeTrMOD336I2F9i+UlwhW8hQKnd4W4VyxssQnj28LuSDvWghjuGgQZEF1AnK27Fkg5hShV0oIjHb8OjIF7w4+Rr21UYEpyBRwT3T9xVWV3k52daU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3395BC433F1; Wed, 10 Apr 2024 16:35:37 +0000 (UTC) Date: Wed, 10 Apr 2024 12:38:13 -0400 From: Steven Rostedt To: LKML , Linux Trace Kernel Cc: Masami Hiramatsu , Mathieu Desnoyers , Chuck Lever , Jeff Layton , Anna Schumaker , linux-nfs@vger.kernel.org Subject: [PATCH] SUNRPC: Fix rpcgss_context trace event acceptor field Message-ID: <20240410123813.2b109227@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit From: "Steven Rostedt (Google)" The rpcgss_context trace event acceptor field is a dynamically sized string that records the "data" parameter. But this parameter is also dependent on the "len" field to determine the size of the data. It needs to use __string_len() helper macro where the length can be passed in. It also incorrectly uses strncpy() to save it instead of __assign_str(). As these macros can change, it is not wise to open code them in trace events. As of commit c759e609030c ("tracing: Remove __assign_str_len()"), __assign_str() can be used for both __string() and __string_len() fields. Before that commit, __assign_str_len() is required to be used. This needs to be noted for backporting. (In actuality, commit c1fa617caeb0 ("tracing: Rework __assign_str() and __string() to not duplicate getting the string") is the commit that makes __string_str_len() obsolete). Cc: stable@vger.kernel.org Fixes: 0c77668ddb4e7 ("SUNRPC: Introduce trace points in rpc_auth_gss.ko") Signed-off-by: Steven Rostedt (Google) --- include/trace/events/rpcgss.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/trace/events/rpcgss.h b/include/trace/events/rpcgss.h index ba2d96a1bc2f..f50fcafc69de 100644 --- a/include/trace/events/rpcgss.h +++ b/include/trace/events/rpcgss.h @@ -609,7 +609,7 @@ TRACE_EVENT(rpcgss_context, __field(unsigned int, timeout) __field(u32, window_size) __field(int, len) - __string(acceptor, data) + __string_len(acceptor, data, len) ), TP_fast_assign( @@ -618,7 +618,7 @@ TRACE_EVENT(rpcgss_context, __entry->timeout = timeout; __entry->window_size = window_size; __entry->len = len; - strncpy(__get_str(acceptor), data, len); + __assign_str(acceptor, data); ), TP_printk("win_size=%u expiry=%lu now=%lu timeout=%u acceptor=%.*s", -- 2.43.0