Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp791606rwl; Thu, 5 Jan 2023 04:45:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXtWLlPlvgziN+qAbgQtg75oXzd+m4lZcDlLojLJ0DGJxRI/pk2pGNC/MpiZG9ljewkRmD4/ X-Received: by 2002:a17:902:e5c5:b0:189:c57c:9a19 with SMTP id u5-20020a170902e5c500b00189c57c9a19mr69649070plf.58.1672922754494; Thu, 05 Jan 2023 04:45:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672922754; cv=none; d=google.com; s=arc-20160816; b=saqGh65L7fdX+UgvnDoLgw4OnZKL08MDe7XBrBENh32hfe1xHXR5bCsLAK2eoa7qSR NcXZM1/ilr89zPdOZLCILGYXoPrs0ndYn03oz5GdlQq3y2g5+bGmyWV0a2zlFUfWNrWv oPjGDOJ7omTFatGNX56NcZnliG25q1z4barzH/7ObLvC2F6iCY+5V2jFkrSx8ORBp5qZ 1SSVt8ygBKSqEVpkkmU5bMlNMk4pYwhN79gY80kYe58WaUH5TN1C6XCWJFmX5Zq7rA7G BT2qqwg7BzNJyZXcsAhoqQOEJy24tKOylk0EVtWQY4evvaNRve/GdCeRurtfTv9e8aTD en1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=yW+PWQQSHw8z6SPIl4Y8ml74/CFKQxO5bTQhi+V36G4=; b=h3BRLujJw1iyP8JsxZx6XaN/D617Sy9vDqjajIJZpCghEVftpPnBI9xT2HlmjZrutW kRl9Wphj7yiMzmdv7ETFerNCKCm4KEqCDBaeiPkbj2FSXMPNQVECk5su7wCUpRILexRE iC9Y5oigSad/lsRmpD7qXsjnDfq4VxQq3LpLGBfNaTC0hWy/Q2JMC8Qx1d1TyVoSFSdz /f9wJmK+fkLSwajHrXd3RJg0+jeiDIjdRe0ssDot2P+qLUNFLRHZOOe+dLtngonlkOnZ m//9aLz8P6ovwfB0IX0Bn5kGWwT5yK2n42rb3xAZwok4tnzUUx7u56D/j85BvqVrjKO6 AxBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020a170902d2c400b001928f34156dsi25928952plc.465.2023.01.05.04.45.45; Thu, 05 Jan 2023 04:45:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232896AbjAEMSU (ORCPT + 57 others); Thu, 5 Jan 2023 07:18:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233118AbjAEMSE (ORCPT ); Thu, 5 Jan 2023 07:18:04 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5785C4FCE1; Thu, 5 Jan 2023 04:18:03 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NnlqF4skCz6FK2Q; Thu, 5 Jan 2023 20:18:01 +0800 (CST) Received: from szxlzmapp05.zte.com.cn ([10.5.230.85]) by mse-fl2.zte.com.cn with SMTP id 305CHs0m064884; Thu, 5 Jan 2023 20:17:54 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp01[null]) by mapi (Zmail) with MAPI id mid14; Thu, 5 Jan 2023 20:17:57 +0800 (CST) Date: Thu, 5 Jan 2023 20:17:57 +0800 (CST) X-Zmail-TransId: 2b0363b6bff5ffffffff94a6df4f X-Mailer: Zmail v1.0 Message-ID: <202301052017571305723@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIHJjdS90cmFjZTogdXNlIHN0cnNjcHkoKSB0byBpbnN0ZWFkIG9mIHN0cm5jcHkoKQ==?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 305CHs0m064884 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 63B6BFF9.000 by FangMail milter! X-FangMail-Envelope: 1672921081/4NnlqF4skCz6FK2Q/63B6BFF9.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63B6BFF9.000/4NnlqF4skCz6FK2Q X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xu Panda The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL-terminated strings. Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- include/trace/events/rcu.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index 90b2fb0292cb..2703992edecd 100644 --- a/include/trace/events/rcu.h +++ b/include/trace/events/rcu.h @@ -776,9 +776,8 @@ TRACE_EVENT_RCU(rcu_torture_read, ), TP_fast_assign( - strncpy(__entry->rcutorturename, rcutorturename, + strscpy(__entry->rcutorturename, rcutorturename, RCUTORTURENAME_LEN); - __entry->rcutorturename[RCUTORTURENAME_LEN - 1] = 0; __entry->rhp = rhp; __entry->secs = secs; __entry->c_old = c_old; -- 2.15.2