Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp492410pxb; Sun, 10 Oct 2021 03:41:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8AzVqxKRMP/Rk9hc47PHCNL7nXd+XbO0dogxK7w668Y+Tx1/lOLLAIdRvh0Pfn8GvD1Wh X-Received: by 2002:a50:9d83:: with SMTP id w3mr31692252ede.305.1633862462329; Sun, 10 Oct 2021 03:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633862462; cv=none; d=google.com; s=arc-20160816; b=UZbIHepsuqGuYo5Pzbgf6ZMnuJpyHVVtHm5xFei4XZyi5gi7ktyy6xNaFCd0FLv135 Bhu1ZD14Gpz3ofiXpjuroJo8HBFxlzfqPM0pndiCSDttbJ/zTfUKtgpGTl8y8sKkO4WK JDGlh05qVK5G+W1zVdJ4TTkMvu0YhSn3dbY/fsXXV7lcppyFXTOM5Fqf0cLuA4cUdImb 6eiHxid5DK2u1zVemkFTfnT9Y95dxKRQwD98v0tTGTDD3fK+m9ikQjuYGiJG4xoxUk/T iNUyDcRlemPFLtQuUaLCwuoNDR7HcPrBxaZRI6dbqCF4WcVmIgLeIjz/RDLAJvIQg6gv tSTQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=50AI/2RIdxgM/cChrsyKhe/+8tNS9PoDTTXEOtoGSS4=; b=eB2mcWyON/FwnCULoAbL3lIkj/F1Itn69dYX1EzNd4gCku1GY7dwvE7v6fOqEshpOW VHRkZenQvSsT6hDgS+dleVyjHYKgQBdOyV5D9iOq2I0Txb0TQqf62uKvSTJMc3cDiGxJ C1LGPiiN/uEMRKcOSvaw1nUAIMNrWKW0KRj/a+eibBoRJQuUyTQTfHIaaiH9DU3vusmX VjJ/ZOFW8S2yz6bFZNoqyqABubXbzWRwTmEskCUcKMcXLY8aIvu0yoyIb/nld2VT9vtV ZdO7c5m5x682cFTbXABsGO3F9NU6sQN5/7E98YXPMuQiJZPgb725OCnnSCQC7sa/1u4d W+Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=n0aHPqJ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lf1si7321433ejb.498.2021.10.10.03.40.39; Sun, 10 Oct 2021 03:41:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=n0aHPqJ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231588AbhJJK1P (ORCPT + 99 others); Sun, 10 Oct 2021 06:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231549AbhJJK1M (ORCPT ); Sun, 10 Oct 2021 06:27:12 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 246FFC061570 for ; Sun, 10 Oct 2021 03:25:14 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so11274204pjb.0 for ; Sun, 10 Oct 2021 03:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=50AI/2RIdxgM/cChrsyKhe/+8tNS9PoDTTXEOtoGSS4=; b=n0aHPqJ+abrMPhqHKgjGff+tDyvHXfJTzEn7QM7X6NySZvTkmCT/wb3GAUETnkvCTt RHL+jYp/lISdxM7jk35zudb/HS5HeiQd35VheuSTJTtSTZyDAGrfVkZfdi9/zSCQLeTO eQStCYA4LCYYpFvhS7O93inAI+DkNSniCFZkFuCbjANhWgrT6eAUtN/qLZazf9VKSPdb 2+vibqlH7/s4Lpy/wZJs5HqLtFtcYM+rPOPPB3K+C2hm0ncn/9XuHWakAVpRJwIvDNR2 G+uxuiUzXcmZhyWpSG70dzZEmBRxn0gnhUmUm5wf2k4KUXioMxEALjc4yaV1dfakXy/L SN4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=50AI/2RIdxgM/cChrsyKhe/+8tNS9PoDTTXEOtoGSS4=; b=FBY5j2owCX4lYF0x9GJjUjLu3LONiBmRcktg30rzR6Ab3+nwwcvV0ty7gel4Nh1WK5 9t+kQ7uK/IwMUf2aSvpiqXiqs9ZA7laF0cuc/t3jboiFUyLNvI+Nr6NSamshRXBWJJ7B Fsi650NLWBrv+UqXKwfbKNposJb/id6yQLprbdN57+/Gpn6okGDn2ct2ryfiv8sm8Sz0 nXRsk78ZAeniAI82VgzQP7TuUtqjLuYJ/erps8bt5ReLSnmpdPSkyDoFopozrLx8NftO a10v7n3r4ELCYce9JCVrAemhbiF4PxVbph+xr0D13zZVCoPQxrMjA9AXzfFPRzGCrfOe s0Cw== X-Gm-Message-State: AOAM533qnEmEP9PYpubrc+KY4iUvOLQHA3vvTG6kdxl9F9n21o5a6Pqj LX+IiYy0xw5F0QqfApExAGU= X-Received: by 2002:a17:90b:3588:: with SMTP id mm8mr23591494pjb.238.1633861513700; Sun, 10 Oct 2021 03:25:13 -0700 (PDT) Received: from vultr.guest ([144.202.123.152]) by smtp.gmail.com with ESMTPSA id w4sm4347494pfb.3.2021.10.10.03.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Oct 2021 03:25:13 -0700 (PDT) From: Yafang Shao To: keescook@chromium.org, rostedt@goodmis.org, peterz@infradead.org, pmladek@suse.com, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, valentin.schneider@arm.com, mathieu.desnoyers@efficios.com, qiang.zhang@windriver.com, robdclark@chromium.org, christian@brauner.io, dietmar.eggemann@arm.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com Cc: linux-kernel@vger.kernel.org, Yafang Shao Subject: [PATCH v3 2/4] fs/exec: use strscpy instead of strlcpy in __set_task_comm Date: Sun, 10 Oct 2021 10:24:27 +0000 Message-Id: <20211010102429.99577-3-laoar.shao@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211010102429.99577-1-laoar.shao@gmail.com> References: <20211010102429.99577-1-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix a warning by checkpatch - WARNING: Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Yafang Shao Acked-by: Kees Cook Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Al Viro Cc: Petr Mladek --- fs/exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exec.c b/fs/exec.c index a098c133d8d7..de804c566200 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1224,7 +1224,7 @@ void __set_task_comm(struct task_struct *tsk, const char *buf, bool exec) { task_lock(tsk); trace_task_rename(tsk, buf); - strlcpy(tsk->comm, buf, sizeof(tsk->comm)); + strscpy(tsk->comm, buf, sizeof(tsk->comm)); task_unlock(tsk); perf_event_comm(tsk, exec); } -- 2.18.2