Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1992496rwb; Wed, 30 Nov 2022 00:21:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf5CmeR79lZHTbH6b41AvghRyPzIeNdrdFuM7f2YuyFWFRTzUaZckL1QWf2HnGbbs3i16NAm X-Received: by 2002:a17:907:77c1:b0:7b2:ace3:f3 with SMTP id kz1-20020a17090777c100b007b2ace300f3mr48203453ejc.341.1669796475783; Wed, 30 Nov 2022 00:21:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669796475; cv=none; d=google.com; s=arc-20160816; b=bSvFNiY+T9Y8f1ozNz4okTovPgzqtTgCI9bwVKAhdlhD2BhaazNehpqtq3uiU7q1Fc ymUxrzCTcH4NPR4dnwO12oQrRHugaChl3S3nbwyyzWA790g+MRN79JsWizp9f7TlL5nz d75tQMW1/yV9S4zaa6aFfmNFXju9d+z5D7VXSQqV6JHAvMcWpqjnR6D8z7dRFaW/NVR7 gOhvzAx1FGdJ63/Tmx7EQp0MAReyR/HRcCSjctfkonZzhDfidcqBRj6GqXhofSqlcYuU uEZrgVdLnGHQ5/f9GfW0ogLXUc3dVLPsCpD5898WMmXmfMweQeQ5rYulxwbX3m5Sj4oO GVeg== 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=SzdVFr3DB2TXmqKvyuF5P/rmvqkekcKVl3u1p4Nqvfk=; b=lTg3jiMCHk+Xe8es7lQVkbD1Jqu4fazQx0V9E0jI9IxvvdkQhdHXsVEQM5rfeUa9x1 s7R6npGH3pvJ45/JjE5eZQ7FmCK4LPCBwAz68Tb/2QqaWBSGU31y06Nd34MWsAk0oGFm pnuDx0CHWeKIwUq36iRHrVGPI6cA0HxlE5c6lKi4//f5i9IRor2AQ033P/kUu7gQTwbl py/Gc51jz7XJRgCIjtgNznvMxpMEbXaToQUMCkvrrhsYU91XkhnNAzalZjN/VYiQShOc 4GJzgvAtBAugl1VC/Bxwybcc+uCfInKhvnHFm3Rg324UenWEmSwNIavL8Bhe4WqKec3a SFGw== 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 x3-20020a05640226c300b0046b807c19b9si910839edd.190.2022.11.30.00.20.55; Wed, 30 Nov 2022 00:21:15 -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 S234088AbiK3IDg (ORCPT + 84 others); Wed, 30 Nov 2022 03:03:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233343AbiK3IDe (ORCPT ); Wed, 30 Nov 2022 03:03:34 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656ED4384B for ; Wed, 30 Nov 2022 00:03:33 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (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 4NMWtC5PVGz8RV7H; Wed, 30 Nov 2022 16:03:31 +0800 (CST) Received: from szxlzmapp01.zte.com.cn ([10.5.231.85]) by mse-fl1.zte.com.cn with SMTP id 2AU83Mb7028919; Wed, 30 Nov 2022 16:03:22 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Wed, 30 Nov 2022 16:03:25 +0800 (CST) Date: Wed, 30 Nov 2022 16:03:25 +0800 (CST) X-Zmail-TransId: 2b0463870e4dffffffffb593ad86 X-Mailer: Zmail v1.0 Message-ID: <202211301603255479087@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIHRyYWNpbmc6IHVzZSBzdHJzY3B5KCkgdG8gaW5zdGVhZCBvZiBzdHJsY3B5KCk=?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2AU83Mb7028919 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 63870E53.003 by FangMail milter! X-FangMail-Envelope: 1669795411/4NMWtC5PVGz8RV7H/63870E53.003/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63870E53.003/4NMWtC5PVGz8RV7H X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, 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 --- kernel/trace/trace_events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 3bfaf560ecc4..e2314d7f4d83 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2813,7 +2813,7 @@ static __init int setup_trace_triggers(char *str) char *buf; int i; - strlcpy(bootup_trigger_buf, str, COMMAND_LINE_SIZE); + strscpy(bootup_trigger_buf, str, COMMAND_LINE_SIZE); ring_buffer_expanded = true; disable_tracing_selftest("running event triggers"); @@ -3608,7 +3608,7 @@ static char bootup_event_buf[COMMAND_LINE_SIZE] __initdata; static __init int setup_trace_event(char *str) { - strlcpy(bootup_event_buf, str, COMMAND_LINE_SIZE); + strscpy(bootup_event_buf, str, COMMAND_LINE_SIZE); ring_buffer_expanded = true; disable_tracing_selftest("running event tracing"); -- 2.15.2