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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BDD91EB64DB for ; Thu, 15 Jun 2023 07:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-ID:Cc:To:References: In-Reply-To:From:Subject:MIME-Version:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tYZpWNQ5jSeS6ZfW9trSdYcr3UUvhqHGUfDDOYILJi4=; b=m1IUnurFTJmNfj ZSKU+x917shQzsAfTOB42+9in8n1+z6LmmjLpnYp3Gx+WiK2QPSm/KvDgwwxWGE0WO/xQmLlmEyTS HP5VXMp0eQKgoDQtF6XYEgW7lJ/yElzZMU8qLBqMJnHfqG3rC7ld2LYOUNgrhbtezcg5i0vi5yws3 H79ia4iK7fgzgsg1UneqZ2SnntyQxcKtVyyNot+cuibWFkESWgp08dcPLIDeKs/TW+gSw2bvPregx 7buaAsVUZRSUQrQJhTiSwdrsBzJ6zFf40w66IoCuKfhCR6AKkt6T8rQhHwulqz6tqHrleiGO2PezT vElyyAes8YkBbBlmrltw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q9hh3-00E4Ez-06; Thu, 15 Jun 2023 07:46:57 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q9hh0-00E4E7-0D; Thu, 15 Jun 2023 07:46:55 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 919A0629DE; Thu, 15 Jun 2023 07:46:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDB15C433C0; Thu, 15 Jun 2023 07:46:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686815212; bh=IYlGV4RSFt1d+yJKhbAG5tqp/00HgK+xkhxKb186tE0=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=u1V90meL+tFm5DgrOOqjff/GVRY8lAfJVHrtgcGEo5XQtqy/ZCHtQOYyWPE63jiuJ 9CNXltDmqldmCvhlH5x6+RmrMm6dDN7MLsKmSj4/yBFdOjR1uM8zlaVYXkJK6t62Qy rjAslRDTddXv05RVMtLk3Zjx4o4mkKsifBNiu9F72ey5saEm2Nx+CdE0nFcualSGwy rRFKTGhSnG40ptlAcczJshlIfErMUeXwsAAhWTQsHac9wEQRSDl3yDmwZ8Mzo1zJDY ZznhnEYIjjq6lvQ+QyGW6AvgSzK1asOeDEaS09cYninfqEB4cN3VAqQ7gbu7vO92e4 up/2YEOgDeIsg== MIME-Version: 1.0 Subject: Re: wifi: mt7601u: replace strlcpy() with strscpy() From: Kalle Valo In-Reply-To: <20230613003458.3538812-1-azeemshaikh38@gmail.com> References: <20230613003458.3538812-1-azeemshaikh38@gmail.com> To: Azeem Shaikh Cc: Jakub Kicinski , linux-hardening@vger.kernel.org, Azeem Shaikh , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Matthias Brugger , AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-ID: <168681520789.8111.6922167548842826655.kvalo@kernel.org> Date: Thu, 15 Jun 2023 07:46:49 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230615_004654_160743_A2CBAA21 X-CRM114-Status: GOOD ( 10.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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(). > > Direct replacement is safe here since DEV_ASSIGN is only used by > TRACE macros and the return values are ignored. > > [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 > Reviewed-by: Kees Cook Patch applied to wireless-next.git, thanks. 7edbd53a58a8 wifi: mt7601u: replace strlcpy() with strscpy() -- https://patchwork.kernel.org/project/linux-wireless/patch/20230613003458.3538812-1-azeemshaikh38@gmail.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel