Received: by 2002:ac8:45c5:0:b0:405:464a:c27a with SMTP id e5csp1268695qto; Thu, 27 Jul 2023 09:22:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlGJftENGNkgNHbXp3FQNY/DNJF8Z5E0q9u6m90+rOUGMddTV20wYEZgM1ERP9ZzLIpyO1kW X-Received: by 2002:a05:6a00:808:b0:667:e17e:85b7 with SMTP id m8-20020a056a00080800b00667e17e85b7mr7332724pfk.1.1690474978681; Thu, 27 Jul 2023 09:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690474978; cv=none; d=google.com; s=arc-20160816; b=LPHHkX5PVH2xju28cFzYud8B2abZ4TaTRtmhqn7dvG4LQ3axtDo59te3unjitugp41 NYpYk2OMAuFrKfEjLk8ddichSY70FEvatwvQ0RxdJ6INhcN4iFaaiTnnrZJL8WppK+mg AhEIT64tK3PCHP/AtqLR04PkyHnM/O4awSgjGhoNPAH+BkIbnnBJrLatUT/0ysQjZs/t nPYGUBzMt+erNT+RrWGJImqGjdW84rwXAv7YkgZjCvFiHCIl0JE3Wi8ObbUAZRP61hie 4FO+9oQT0SosWoLUOen/h/IL8QcqKxoqPAorlEfCv0lVP9Xpfs7oUD4PNgW5aD84ZQxJ zkeQ== 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=pyEHfmIdAZusP8ylrb9Uotw6HIeOEzJpt2mwB5LGftM=; fh=HtBQxF0pa2aSoEhj/Z4eJ+euJpHV4isUqV37eCWs8sw=; b=dHcVYzHAqbroPu0Ng+nnWDay7W5Vnms6yJrqm3hYem5pacGRKZb+gS3RxuoZZzDkUe dajX8ufxuaGwZP581HbOcYIARiCzvpcsk4xFxOsAEZUzYwk7tGqUYmU6H061Yv2huXBD Z/jO2soLQ1kTMRJOXgmw0dPFNHUdQywFZey76laBO1d2entl72NF5RrpT2xv2Xjf2S77 g+Ml/uo17VgDK8dh7wsCsQ03L7gz+JIBeyTQ2Kh9bcmPXjTgyB69PJsfDh9U8D6IZitA cHh9QxqtqMQu+ByDCqvM25O0+d/Vafd1oVkKXXE7xV2BjVSgGb7oLxfOuAJ/pQfYVv2S zm3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Qcb8L8Ho; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by9-20020a056a00400900b006666b36b0desi1547818pfb.361.2023.07.27.09.22.50; Thu, 27 Jul 2023 09:22:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@chromium.org header.s=google header.b=Qcb8L8Ho; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233954AbjG0PyB (ORCPT + 58 others); Thu, 27 Jul 2023 11:54:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233710AbjG0PxE (ORCPT ); Thu, 27 Jul 2023 11:53:04 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3568DBC for ; Thu, 27 Jul 2023 08:53:03 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-686f0d66652so990990b3a.2 for ; Thu, 27 Jul 2023 08:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690473183; x=1691077983; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pyEHfmIdAZusP8ylrb9Uotw6HIeOEzJpt2mwB5LGftM=; b=Qcb8L8Ho6rOn1rC0EiVFDR15Gh9M3knRrx7sGFT9bNXn73IpUcHWtyKa13fEUffXeK UtOsTQxVrQm4KgUF6Bbc1cwf4alq6fcsogcAjy7fWRZzjcBGeLPKUvlLclFTldRRCjGi Qo84N3OjMXDAmjirE1Idm2pfWEUd1qgnKpFqs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690473183; x=1691077983; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pyEHfmIdAZusP8ylrb9Uotw6HIeOEzJpt2mwB5LGftM=; b=QePgfM1bEqvWniYoUni5GvNnNM2Ql5JLZGZVWambpU+cyTqSn3y3GfDF1SvTIFX15m UxJE4KZWw21NSitzo75X+fSpn/VQT7tnevRZaZJn8U3PBSbsEhm0XA/AeFuFDSFvflmw H9VuDaSdC8iuLSv/2ybf7sCq8/qulTp5zUYd9pWukWVrSV4YPSqa5qmuQ9fPJoVSXB3J SxFDivaMzBdFJfo8rapyMq494ftG+7kvCqxQuc4EUmqdo/jtbCMrgppi4Ncruu/fHvjg 1mrnQxXrP6JnUqPq3nG0LePYTTHNVRwVdYKgMjR9V7Z8kI1jOVYOPXwPqPeUiJBsXcw0 /PYw== X-Gm-Message-State: ABy/qLbR7jBcxlfr/wvC+/cs9vSDqNhVSp+JmVLlKEiQQozEzMungdJw oDe8Ii9UAwMUHFrrW0DawO0cLg== X-Received: by 2002:a17:902:dac4:b0:1bb:cd10:8209 with SMTP id q4-20020a170902dac400b001bbcd108209mr5450270plx.50.1690473182764; Thu, 27 Jul 2023 08:53:02 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id q16-20020a170902dad000b001b89c313185sm1807914plx.205.2023.07.27.08.52.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 08:52:59 -0700 (PDT) From: Kees Cook To: Amitkumar Karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu , Azeem Shaikh Cc: Kees Cook , linux-hardening@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Kalle Valo Subject: Re: [PATCH] wifi: mwifiex: Replace strlcpy with strscpy Date: Thu, 27 Jul 2023 08:52:56 -0700 Message-Id: <169047317161.2400214.15246406234885315012.b4-ty@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710030625.812707-1-azeemshaikh38@gmail.com> References: <20230710030625.812707-1-azeemshaikh38@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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-wireless@vger.kernel.org On Mon, 10 Jul 2023 03:06:25 +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(). > > [...] Applied, thanks! [1/1] wifi: mwifiex: Replace strlcpy with strscpy https://git.kernel.org/kees/c/5469fb73e96d Best regards, -- Kees Cook