Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp671722imw; Thu, 14 Jul 2022 08:41:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sfCunc9OBGBKwdrPdzQ/StYn8FwqY7taFoJJkdfNPN9XahPRk1VhDa06LIpShK1x3ylkih X-Received: by 2002:a17:902:c641:b0:16b:dd82:c04 with SMTP id s1-20020a170902c64100b0016bdd820c04mr8862322pls.144.1657813294464; Thu, 14 Jul 2022 08:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657813294; cv=none; d=google.com; s=arc-20160816; b=iQEIGRy7DrSaN6g1d5Jgweuy7mVkPuiNEhT5pu6fL33Cz3zPrd6r5LVUPzHmK+lGwH IBUat8tFQYwjmqQFuj5+rS8h/EFVWvN5vg263pCXkmgrbztkIBjriX8BFj9duRD9fvU+ TTIhlX3/2PM7UKebtEHZuH5WowRqIsrJMgecmw9OfUEJrtXD/SuU/vxF7Aw50dTF9erl OAIp11S1kJMsQAknd8Dra+szwJu6kxO3/nJrD6tT9z28dZyRWBPV6FLAdVtwoSY3Qew6 4ci/yGsJpiG2Jitsn9l8126+dKQQTGrvcHuQB1zADN5KGTNbsL596Kt+8VucRJXP+cEU Xw8A== 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=mpFwBg17MPLedEeXsKR0g11KSb+p+AI/SVxHMocug7Y=; b=MLgPiUpDwvN6e7I9MNAgycw56X1PA7trslQ2KrkRvfp/lliNpQfVbupyf/T9hngyPU H8G7Eu0es6qL2QgBLuPD06QwwdoVUZ1r5n1LJ8p4cEfkBnMNXA7yogeRwlrK3LMj+KT7 /Ab0NqMIyN65Jp0uCTAV/57kMtIktRyj2E4RqaDMx+mmXg7uww0YFas6mi6WL7j/imhF 14Ut64GX5GxKb/HEPNOuNkLd405jWYXaXQFztJJ0oW7D5Sq8VQRVzejWAj/SRd/D7Zwm uLpo2LvaHv46L8oNw5FD50VJ8el/eO/H027Wwlwj6QNnXj796aWRgwftUWhQUyBQt4QX oPfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=im3+HXNi; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a63e145000000b0041278f22d6csi2040473pgk.220.2022.07.14.08.41.20; Thu, 14 Jul 2022 08:41:34 -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=@redhat.com header.s=mimecast20190719 header.b=im3+HXNi; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240390AbiGNPjq (ORCPT + 99 others); Thu, 14 Jul 2022 11:39:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240311AbiGNPjn (ORCPT ); Thu, 14 Jul 2022 11:39:43 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00EA328706 for ; Thu, 14 Jul 2022 08:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657813181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mpFwBg17MPLedEeXsKR0g11KSb+p+AI/SVxHMocug7Y=; b=im3+HXNiGhqsGk95vksTV3nLDDlrMfH7TZ4WYTU8TDxB58D3CW8NQuS2BPTI/OykRSNNic TwlQv288U+JCoqsTHG50e7QS5zy6x7FQNOAx4+lrkWCPvvvz17wBtVhnIl2cpUjq/yGdBQ 1nEeTFAxoV2R0TY1zwnIIDob/dUmh0w= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-97-_YV2GfGVO_yHwy21RbcE5Q-1; Thu, 14 Jul 2022 11:39:40 -0400 X-MC-Unique: _YV2GfGVO_yHwy21RbcE5Q-1 Received: by mail-wm1-f71.google.com with SMTP id z11-20020a05600c0a0b00b003a043991610so899023wmp.8 for ; Thu, 14 Jul 2022 08:39:40 -0700 (PDT) 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=mpFwBg17MPLedEeXsKR0g11KSb+p+AI/SVxHMocug7Y=; b=QBHceKDOXFU715s+Iz677PDkig61umlWQxxhm2rdMXVOg7VwOSFw+kiTBJwI8pAqgN IHbIG8cXSMYNiM2ZoP9nHwVcliWgWbbvLgsfoUUnE81SVW4egKK7WJ27KEDzscIJ2tOJ oY/IXhB2GXZhYc+Wvss0aJ0BSKaXqyrQ5Xjn+InVXn8rfxRyXZOAIo+fpDQuk09DB2nY k2q10VZuIzNDzfQmNJV5R6KDknGN6pYK74yu0CRSVQ14wGKZ2ienHATdvUZgarE01QVj jMoLdPnnl1866HKt+Lw6HPUJWmiOY+r+W4BB9U6ejnD9DdNFg5OcEsCeOQ3z9c3g/xwI /MdA== X-Gm-Message-State: AJIora8cQkG8RPSAXUyitT5EnM3MZZKaUskFz6M/NqUDKTYp7XgSPiXZ SC5j6suCFkYyPiVwl9O8YiPTgzyINOb6aJQVjFw+cyCmP/PbCEtIAmfGKVsed6iGIl53WjGsMn2 bbNahwGtuv4cGhRlYVzM/s8A= X-Received: by 2002:adf:f746:0:b0:21d:6afd:b7d3 with SMTP id z6-20020adff746000000b0021d6afdb7d3mr8680745wrp.501.1657813179272; Thu, 14 Jul 2022 08:39:39 -0700 (PDT) X-Received: by 2002:adf:f746:0:b0:21d:6afd:b7d3 with SMTP id z6-20020adff746000000b0021d6afdb7d3mr8680732wrp.501.1657813179045; Thu, 14 Jul 2022 08:39:39 -0700 (PDT) Received: from localhost (cpc111743-lutn13-2-0-cust979.9-3.cable.virginm.net. [82.17.115.212]) by smtp.gmail.com with ESMTPSA id w10-20020adfcd0a000000b0021d888e1132sm1729356wrm.43.2022.07.14.08.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 08:39:38 -0700 (PDT) From: Aaron Tomlin To: mcgrof@kernel.org, christophe.leroy@csgroup.eu Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, atomlin@atomlin.com, oleksandr@natalenko.name, neelx@redhat.com Subject: [PATCH v2 2/3] module: Use strscpy() for last_unloaded_module Date: Thu, 14 Jul 2022 16:39:32 +0100 Message-Id: <20220714153933.2095776-3-atomlin@redhat.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220714153933.2095776-1-atomlin@redhat.com> References: <20220714153933.2095776-1-atomlin@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 The use of strlcpy() is considered deprecated [1]. In this particular context, there is no need to remain with strlcpy(). Therefore we transition to strscpy(). [1]: https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy Signed-off-by: Aaron Tomlin --- kernel/module/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index a4d23b0ebbc0..c5db13d06995 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -754,7 +754,7 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, async_synchronize_full(); /* Store the name of the last unloaded module for diagnostic purposes */ - strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); + strscpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); free_module(mod); /* someone could wait for the module in add_unformed_module() */ -- 2.34.3