Message ID | 20221020091312.398909-1-cui.jinpeng2@zte.com.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp151004wrs; Thu, 20 Oct 2022 02:20:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6aIq5Abf9mO50o5FwPfb8uwRv4NciXz8mpOyGtCnHiQoeNtopQ2/++A+QV9+y4BsWnLp8h X-Received: by 2002:a17:907:1624:b0:78d:d61c:2b4a with SMTP id hb36-20020a170907162400b0078dd61c2b4amr9997745ejc.208.1666257649399; Thu, 20 Oct 2022 02:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666257649; cv=none; d=google.com; s=arc-20160816; b=qcgLz5PNHYsb4wk415+KEO7M1d0u3lVsoTHnuPRjhk99LI6ixaROb4osUTdpESFamv EStDhYTG8e/MIBxi1NXA2nVPEJSVMDmnGE90q+/RULcmGNApXRYwTNr4N+/OHrBdLkB2 pAIz5JIfhG6S51SqjdC7D9g8VqN1Pp6VQVH8/1ZikWKqWzWkmt7WoOSdrm9+ERNneTjO zYXOQJPjkMn/rWZaF4IGcAmYcw+SIRnZzSTWgxjwc8KtVzORwwajPPgLY9gD0d8BWMvh Ok/N7Mr8VC7Xm91eEYajWf/aSyfQH2plHPqn92O1uP2vFSk0Ft/FZDJlkPAaQIMYCLkd nv3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QIkOjdfRRSw8uTKf7w3SgpX1a+ci3tK/XI45o7Lmcd0=; b=gmotR/83FfmikQGi30DqyGmK3dKZhuBzQIh9YCq3S3T6IX3/w4GFXG0TY8BnC66ifg mcvwP+TgUIroaNoqSqgC+rkFxYG6udEGYG0XF4ixajfi6lMB6VjPjPOjPQez06NmeZfO B6DsJx3WxQFdnw2jRxW/dJqG+iwlbeTIoE+VrcNV0Usu3VVc3i4EHAZJqAkvxJrdSS7r c/0hlNvDsQ3W3XBOO6XoRRqjb5tsNNCY5IpLCsDg8u2BvnkcGKO4FFAimOeHvSozU3gY eHGSysP7pK9h5DP0aqoVqvLPh8G7F219+8i0DhHUhm5NJP2cOFzU90nEPpaz87Ue4Gq1 C/pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ha7y9Yf2; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd33-20020a17090762a100b0077ac5f39842si19316088ejc.96.2022.10.20.02.20.24; Thu, 20 Oct 2022 02:20:49 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ha7y9Yf2; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230318AbiJTJNU (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Thu, 20 Oct 2022 05:13:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbiJTJNS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 20 Oct 2022 05:13:18 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F92119E002 for <linux-kernel@vger.kernel.org>; Thu, 20 Oct 2022 02:13:17 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id p6-20020a17090a748600b002103d1ef63aso2476392pjk.1 for <linux-kernel@vger.kernel.org>; Thu, 20 Oct 2022 02:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QIkOjdfRRSw8uTKf7w3SgpX1a+ci3tK/XI45o7Lmcd0=; b=Ha7y9Yf2v2Xtk+Fi5cUhvaW1VbOaRYCHgR5mdJNzBz4od55HuB8WGDQQ7KL7mnyDSd i4n6AQRIKRNeMK3BD5xnOENddtz2o843F98D6IQlSQ/wZefRbh7TuDVNA5m/lsI8Buzv XrnZdAMWKWQgQKe6IUWCMv3S3EkdTNudoDYmM6ZLXL/GDNROnsdztuNvrIzwgM3FDAY6 omXL5e9Fw/Hj6Zx0XiHhKFSo8pxuJpi5HOgDJFOPUR2q6nMRQrYtkapZp2l9aLcqyfx0 ezBtHSCejQ7kAOu3lV8S2uAdd7o9G/vv8xjQiCnk9YvtQGPfQsqJNvX91vY+cehxBNBz s44A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QIkOjdfRRSw8uTKf7w3SgpX1a+ci3tK/XI45o7Lmcd0=; b=k1zJxJhcA/n1wQKJgBPnFkVil1T4NvVkukTHYqzKMb08iSO+/Qcm0r0STbGe5HAJ3g LFgdy8JfEyJx9fyUPFZQnlN+VadCfNKMNoHeA4P+T7+BxbeeaEHuoJBbugdPE21SxsJc /GGCiQMGyA2NjJ8OqThC6UFQpsZ2qEaxN4SNsw9QvvtOaqJ3n0e4DGsid3masuxgVq3K 4J0ERvbe878XGfL77lzQ4m06W26Np+AhbtRu8dNFzzS+hgN1GM01/p9ub11qK9h8hxbM GZePYL39OgdZ/GXigJggZYvFkuRa6lTpexsoKirwwtYJYlDw9AqGR0j3FmeCdxtKdr1X SI1w== X-Gm-Message-State: ACrzQf1LgdVObQPU9WQuv1dnDYhgq9zaNv2IbFfUHhS0ZVx8FBLElPHv LG0tQz9rXt9bZKN1qWkkUNc= X-Received: by 2002:a17:90b:1bd2:b0:20d:dcb0:c788 with SMTP id oa18-20020a17090b1bd200b0020ddcb0c788mr15221042pjb.67.1666257197205; Thu, 20 Oct 2022 02:13:17 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id p65-20020a625b44000000b0053e4296e1d3sm12751049pfb.198.2022.10.20.02.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 02:13:16 -0700 (PDT) From: cuijinpeng666@gmail.com X-Google-Original-From: cui.jinpeng2@zte.com.cn To: jstultz@google.com, tglx@linutronix.de Cc: sboyd@kernel.org, linux-kernel@vger.kernel.org, Jinpeng Cui <cui.jinpeng2@zte.com.cn>, Zeal Robot <zaelci@zte.com.cn> Subject: [PATCH linux-next] clocksource: Use strscpy() instead of strlcpy() Date: Thu, 20 Oct 2022 09:13:12 +0000 Message-Id: <20221020091312.398909-1-cui.jinpeng2@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747197780988835535?= X-GMAIL-MSGID: =?utf-8?q?1747197780988835535?= |
Series |
[linux-next] clocksource: Use strscpy() instead of strlcpy()
|
|
Commit Message
cuijinpeng666@gmail.com
Oct. 20, 2022, 9:13 a.m. UTC
From: Jinpeng Cui <cui.jinpeng2@zte.com.cn> The implementation of strscpy() is more robust and safer. Reported-by: Zeal Robot <zaelci@zte.com.cn> Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn> --- kernel/time/clocksource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Oct 20, 2022 at 09:13:12AM +0000, cuijinpeng666@gmail.com wrote: > From: Jinpeng Cui <cui.jinpeng2@zte.com.cn> > > The implementation of strscpy() is more robust and safer. > > Reported-by: Zeal Robot <zaelci@zte.com.cn> > Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn> > --- > kernel/time/clocksource.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Please ignore based on this response: https://lore.kernel.org/r/Y1EVnZS9BalesrC1@kroah.com
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index dcaf38c06216..a3e7edfbb3c2 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -1461,7 +1461,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; }