Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8761320rwb; Thu, 24 Nov 2022 04:04:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf4O2W0SXDXxcdC8YH1UtNDEausdZ6HYEuD9vk6oCosf27exxA6FGRBmUKVXY2ztoPi6j4pK X-Received: by 2002:a17:906:234a:b0:7ac:e7b1:20c8 with SMTP id m10-20020a170906234a00b007ace7b120c8mr15017296eja.68.1669291488006; Thu, 24 Nov 2022 04:04:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669291487; cv=none; d=google.com; s=arc-20160816; b=wgtdnYT7LszgZ61ti1jJFEeyjslh6+8f+VzPulB4AK4cO7x+7PyuS/0L0qDQTywIV9 NwBQJbFCx5KmCm6UbdLKNMG2Dnj/m2RIaV6IcbZWdFv20/GMUmVLDl9HgeGIBldxGNE+ mxetunrjnW0NsC3tAExcJO6KrGCZc1R9KGp6bzBINyp7wEHAPeLm482TSc4VRJ/jp2dz JudvRjtzYjArrulNdRNDpflmINW2D6tQXNGOpY6SOO6MntpRmO/DuXs4D+mfEy+BEvIQ 8OY6Vys5ZN66AunvyDgMRjNXX0+b2clXneUvPb8KJUbCDvPV3W0MilL07iC5WTbhFwVx 1TcA== 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=hyuNQeunpjATZ2GLFSRYseZ7vxrfxYGkAu3zWQAoW2E=; b=bSCa9bxafIzJgiIxC8xWxXcKqV09/NOQ2lDBujR+3zhAUQOXFKgsR0Y8eFTdpxHYnF utT3ak1D4SRP5WNZcmMgxjPeV3bUO7Ogxo5wCzIlBZUJytVfYNzaNo/Jj3ENKrSu/wGh qBWiC95+s9/SiWyGYB+BBo9pwHG50f7dod0HBOiU17pZ84M5adfcgRgWrYhL6GPF10TO xwnParj2W83uTf2qc6grl42ggTFDaiM+j3fb414O3WM8zfKm/w267tv7LzkPOZ3uCJAe ko1PmdA6ArEhcWhk13Cwjq1oRx+8bVw/fLFXn+/UYXKoOUcF0BU9vEPQExBftBvnaDgD 4HqQ== 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 h11-20020a05640250cb00b0046a642710cesi938336edb.254.2022.11.24.04.04.26; Thu, 24 Nov 2022 04:04:47 -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 S229569AbiKXLYv (ORCPT + 86 others); Thu, 24 Nov 2022 06:24:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiKXLYt (ORCPT ); Thu, 24 Nov 2022 06:24:49 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3517C2529C for ; Thu, 24 Nov 2022 03:24:47 -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 mxct.zte.com.cn (FangMail) with ESMTPS id 4NHwd92r6Fz501Qj; Thu, 24 Nov 2022 19:24:45 +0800 (CST) Received: from szxlzmapp01.zte.com.cn ([10.5.231.85]) by mse-fl1.zte.com.cn with SMTP id 2AOBOXsN025208; Thu, 24 Nov 2022 19:24:33 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Thu, 24 Nov 2022 19:24:36 +0800 (CST) Date: Thu, 24 Nov 2022 19:24:36 +0800 (CST) X-Zmail-TransId: 2b04637f5474503e4e51 X-Mailer: Zmail v1.0 Message-ID: <202211241924364726330@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIGNsb2Nrc291cmNlOiB1c2Ugc3Ryc2NweSgpIHRvIGluc3RlYWQgb2Ygc3RybGNweSgp?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2AOBOXsN025208 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 637F547D.001 by FangMail milter! X-FangMail-Envelope: 1669289085/4NHwd92r6Fz501Qj/637F547D.001/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 637F547D.001/4NHwd92r6Fz501Qj 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 --- kernel/time/clocksource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 4a2c3bb92e2e..d59b05409a22 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -1450,7 +1450,7 @@ static int __init boot_override_clocksource(char* str) { mutex_lock(&clocksource_mutex); if (str) - strlcpy(override_name, str, sizeof(override_name)); + strscpy(override_name, str, sizeof(override_name)); mutex_unlock(&clocksource_mutex); return 1; } -- 2.15.2