Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp819874rwd; Thu, 25 May 2023 04:35:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6YxJf4uKjBC4ligcujxmZK6Q8ZYekcPZEs6eD5uvzTp1CvwJ58UtlaNwdo7X2esztK9dnA X-Received: by 2002:aa7:88cd:0:b0:645:8a69:faad with SMTP id k13-20020aa788cd000000b006458a69faadmr9728613pff.14.1685014506962; Thu, 25 May 2023 04:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685014506; cv=none; d=google.com; s=arc-20160816; b=QgwGiMv05Zx9PlkMMXdetErNkzRlyl+SGlNXadJsEQLLDoQfXHXOPeXdQYmL4mceQD nMAUXc3QHtu6uasMbwWOUFKN+lsaAGIYcaRl0pskyeo1+McONiz3xj+CgrJFGEKni9wf At2tyDlFovrS5gOw++BRelHJcI+U7iUUx3D1eheSrBWqQXHNukeA845Splg77fV5UVQB d2NHhusgGHqbl7pOkfUbeVVnM9+6UL1DI9aDScg+qLXmUNd7zhP8kyfqZJtN7Uh4Nk+5 YDO/ZGJ/O5yZhTBcP9ausA9AeeI0lYgV81cmP6FeCshXE8YX2kl4b9u5JoWIGmME9Gzw 7ziw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nE7fWH/aOaBs5RQ6S3syiUZHKQ7NMgGAdMFhzyjTtcY=; b=Z8s/VRQIZQ3upk8EGkaTv8ht4fjQBQSoZYt+TkBVqrA1iiNmY08xkOw4zL7b4Hw9+6 85Zd0VncHLMxwlVAw2n1qOkLTASWs7haECGWINGpR0KFE2xZmcraHZlgQC7koAAM7JRp BjFQv89SwHuT+NROxzeqe5t0iCZJaChSDFhVfNmTUIqgLHqiE5WptfPb9vgGF9VKr9BH WaOMapXhl8EG3DEvfiov5yw8gDXJQ1GlTGgluNgy1kDuoxUTq9hTquvVrGgvAf1BQ/J0 oollB/dUUi0rzsrZCLoAZ9q7KA/78TF7V2aaEFmftCpegtStVm0aIDQ5EmdlVTyQZTiY cHXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=biPs19dk; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020aa797a4000000b0064d5dcc9b8asi1316941pfq.125.2023.05.25.04.34.50; Thu, 25 May 2023 04:35:06 -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=@kernel.org header.s=k20201202 header.b=biPs19dk; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240926AbjEYLbq (ORCPT + 99 others); Thu, 25 May 2023 07:31:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233558AbjEYLbo (ORCPT ); Thu, 25 May 2023 07:31:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D38FE4A; Thu, 25 May 2023 04:31:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D71FC64501; Thu, 25 May 2023 11:31:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3EFEC433EF; Thu, 25 May 2023 11:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685014292; bh=4Dz9zMJVhxwMMiquc88J5UTjI72zXQLwzeT/4mr38VY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=biPs19dkMBRvz+eupbEagngMdLtHrzltjYKo7RPIOy+428C5+o8aWHIrAHSDFUIY5 csL6OR2vN6Bj/MGkBrJEyBaF9cAzhcq13JkH5cO4KJpi/cZc4lENp9VK6+w52SX33D tXvX+iuxLSJc3j3W4XjBjd9dvtL2de2DK8Ztew973b1KvTtfkN+t7+iVfqpwy53FL7 kCGhYnca9c9/vgDGqmTBbYoHWXrUqfYDf+TVJuS8s+rVGzd6bDSwFMPVE88cjwjJBP VS3xUSmR8E4g+rw5ThyJBjzRxLCjQ7GN27hx6AwYK+vKVxDn/Iqj5qvvp9D5Q6Yx/2 r3mnkiDCsvJcw== Date: Thu, 25 May 2023 12:31:27 +0100 From: Lee Jones To: Azeem Shaikh Cc: Jan-Simon Moeller , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Pavel Machek , linux-leds@vger.kernel.org Subject: Re: [PATCH] leds: blinkm: Replace all non-returning strlcpy with strscpy Message-ID: <20230525113127.GD423913@google.com> References: <20230523021228.2406112-1-azeemshaikh38@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230523021228.2406112-1-azeemshaikh38@gmail.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 On Tue, 23 May 2023, Azeem Shaikh wrote: > strlcpy() reads the entire source buffer first. > This read may exceed the destination size limit. > This is both inefficient and can lead to linear read > overflows if a source string is not NUL-terminated [1]. > In an effort to remove strlcpy() completely [2], replace > strlcpy() here with strscpy(). > No return values were used, so direct replacement is safe. > > [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy > [2] https://github.com/KSPP/linux/issues/89 > > Signed-off-by: Azeem Shaikh > --- > drivers/leds/leds-blinkm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks -- Lee Jones [李琼斯]