From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92651C7EE26 for ; Tue, 23 May 2023 17:22:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238058AbjEWRWV (ORCPT ); Tue, 23 May 2023 13:22:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238057AbjEWRWU (ORCPT ); Tue, 23 May 2023 13:22:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2C1218E; Tue, 23 May 2023 10:21:57 -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 26C78634FC; Tue, 23 May 2023 17:21:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C999C4339B; Tue, 23 May 2023 17:21:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684862516; bh=VonElC8wOqM+LDZvf96EDpTmmf7XGYZNo7lSoNX7MvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qgkgY52gosRPlhPkg1lcyCVYJ7yXg4hXYtHMPyRd+JWfGqeP3zQeyTWwo5IeHQaJx l2+hWw/h7dl8814tBajCwHeIUSsuF/F+uHBAjWsl4vZ2UKSgMi3zo7ZrwiXm6FBVw0 qsODYwcepkXjxczxys9GWoEK1o5Ph091t9Q8glEncAhOhas2VdeLt0FFO5qXFMBAAN fHLf3iBrfZYxhTfJW9HplhGaLGPEAmc5ec6M2jLvUZfFfwzVe8s/af3IloZ075S803 wTji+8LNmZpOy934aXtQGDd8qxCTWU7uOdZqGti42iYO5V/dYdnInZPxg4CXbecNwk 4uju8eX08/OtA== From: rfoss@kernel.org To: Andrzej Hajda , Azeem Shaikh , Neil Armstrong Cc: Robert Foss , linux-kernel@vger.kernel.org, Jonas Karlman , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Daniel Vetter , Guillaume BRUN , linux-hardening@vger.kernel.org, Jernej Skrabec , Lucas Stach , David Airlie , Laurent Pinchart , Maxime Ripard , dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/bridge: dw-hdmi: Replace all non-returning strlcpy with strscpy Date: Tue, 23 May 2023 19:21:49 +0200 Message-Id: <168486250045.3617730.17499429425987433532.b4-ty@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230522155210.2336690-1-azeemshaikh38@gmail.com> References: <20230522155210.2336690-1-azeemshaikh38@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org From: Robert Foss On Mon, 22 May 2023 15:52:10 +0000, 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. > > [...] Applied, thanks! [1/1] drm/bridge: dw-hdmi: Replace all non-returning strlcpy with strscpy https://cgit.freedesktop.org/drm/drm-misc/commit/?id=37cee4876a45 Rob