Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3244460rdh; Thu, 28 Sep 2023 06:45:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH98KNumMnYsKbsFAu4rzeP9ZjQ2f79jOJnW99cwY7xs7P0KOh/ZgbUHFmRLTsj4XTPoSoO X-Received: by 2002:a1f:49c5:0:b0:48d:1fcd:9760 with SMTP id w188-20020a1f49c5000000b0048d1fcd9760mr964223vka.10.1695908748723; Thu, 28 Sep 2023 06:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695908748; cv=none; d=google.com; s=arc-20160816; b=lKncALgFz2WO3Mz2ZztOw1qgqZfDO7RGc+0x6fH4XbwN48h3TiDUxUXVgw6zfSrgP5 4hPQK3LSElNHSAMDp18IqJBJCIAqJCsG/eBnsFJwY3VgDVOswQAomI4CuQ/r2i/ii5hB 2++uF8b1NnaM5YuR6cEoSrJaej41xXxoWsZm/yQ4CMbrmjTmGjPZmRj8Lpzdtg2cgPbW x6BvM4gm6GPa2oLAasPHy7LY/rMaVQOqGL7OFQNkJTt6GJuv7PAnA+mH5xOYFEAEZhCo iUD5b++n9lJ4YFAS9mPfVtnBndRjmawQmvMfrkR5oyDFL1sYVHxCc2OB0ZX1Bu3uKu2W almw== 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:date :message-id:subject:references:in-reply-to:cc:to:from:dkim-signature; bh=ASHOHeHKpq42S9DoTpZ862cILujHbmUMTzpS7GAZ9HU=; fh=th0dXnl0DBh/njF6fjphcEexwLsFGsgev56gNCLqf3g=; b=XwQRx+Viu7fgJb/pbhwJWJngGcImPzKYR14py+VCZleWikzT+3wwoAgh4NP88K8XEo cJqcQxbxosbwTLE2THL1CCpJJNrScz+vUsvvygTWYuCLxCHOxFdN6W0A6DxEJcmDwCRk +ro7UkkTAGRIYPYx2tNAKnNzmAAGxOcvd482Ritbg4yDm8PA9f3LBIW5VcQ1bJ34XQfJ 7OYVmMckWWwy7styDYltvkR6zKHTjD+aNjmyLq3OtJOz4IjQV4JoUcM+kFe3lSjYSivN 1tuljdWrcJtR+YoiF4bcKzNrzZvFd798BoiBkyopiFg40LsHbHuenn1+QUsMPabRHPUL SFgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mav+ZW23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j2-20020a056a00130200b00690da05391fsi19495187pfu.255.2023.09.28.06.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 06:45:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mav+ZW23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 650318074E16; Thu, 28 Sep 2023 06:41:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232284AbjI1Nlf (ORCPT + 99 others); Thu, 28 Sep 2023 09:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231966AbjI1Nle (ORCPT ); Thu, 28 Sep 2023 09:41:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41BC219C; Thu, 28 Sep 2023 06:41:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA69FC433C8; Thu, 28 Sep 2023 13:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695908491; bh=rJxLo1ABDRJDSxy1BujIrMAZQ/znSO0a+HwmrquB1+U=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=mav+ZW23Dj6p8y5GSitPt1RgAPgFnreDpKvaTT6jmn2sRET+o9tGZOq2vct+4wJ6p MCV8h6xcv3Y5m81H44uouJ6banZb+ZuA0Fl/yCI7xzrOSbD+kSjc3ZK0C4tE9KiDhF 2SeONbWxfHiJwFLNbBj+jY9iCz+eIAT8Vxa7VD90pT997dMhU8rgpjFO7/wJx6nycQ OrqX2d9nItKFqSD4BRx1sKWnSRZjyd4NsX52kcB+6N0yyAXSlmmIaOe6xs5m4llaXl o8TjNhUw1SxgRvIvrv6NkpaG2Kq+rlIdBN8CRzEMzGeyc1F8usoGT0oIpB72QnFybG pIrof6A38DGHw== From: Lee Jones To: Pavel Machek , Lee Jones , Justin Stitt Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org In-Reply-To: <20230922-strncpy-drivers-leds-leds-lp3952-c-v1-1-4941d6f60ca4@google.com> References: <20230922-strncpy-drivers-leds-leds-lp3952-c-v1-1-4941d6f60ca4@google.com> Subject: Re: (subset) [PATCH] leds: lp3952: replace deprecated strncpy with strscpy Message-Id: <169590849042.1603670.14283146758350554856.b4-ty@kernel.org> Date: Thu, 28 Sep 2023 14:41:30 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 06:41:42 -0700 (PDT) On Fri, 22 Sep 2023 15:27:17 +0000, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We expect `dest` to be NUL-terminated due to its use with dev_err. > > lp3952_get_label()'s dest argument is priv->leds[i].name: > | acpi_ret = lp3952_get_label(&priv->client->dev, led_name_hdl[i], > | priv->leds[i].name); > ... which is then assigned to: > | priv->leds[i].cdev.name = priv->leds[i].name; > ... which is used with a format string > | dev_err(&priv->client->dev, > | "couldn't register LED %s\n", > | priv->leds[i].cdev.name); > > [...] Applied, thanks! [1/1] leds: lp3952: replace deprecated strncpy with strscpy commit: 821d3ff4b4e2c689576a623348555114e3f2f1c2 -- Lee Jones [李琼斯]