Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp236890rwb; Wed, 21 Sep 2022 21:23:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM63l88VIqGIxg/ClWytyom1CaVFAl/LugbBQjbwVGr182+Tr5RxamYMRRoH26MDH+U2uIyB X-Received: by 2002:a17:906:eec7:b0:733:189f:b07a with SMTP id wu7-20020a170906eec700b00733189fb07amr1232064ejb.230.1663820637329; Wed, 21 Sep 2022 21:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663820637; cv=none; d=google.com; s=arc-20160816; b=X01nhvNupCPQ57mOsed78d+89ZJtPiJ+5BDJu0ak/LPVJKaUicPrb2w4v5LJ14TtfN 7EWlgYeSar8W6mHBp6i7HzutNnfHCAgeP7gk2D1lP+1rD3qf2MRtdlKd899EZ0/PkuXR SN8o07ReoqDpaUe4D2Es4Q5djuzGFcHIW/B/OERhwIAhBKrpes8Iex8DCFOj7vUbp4H4 3wDtE/83aNZIytq3vj/pwChqunS3byGIpB7KOTSMxnsHxmzXHg9SS+47owgmsH+ghg21 U8hygI5yq5IKD21tuL2aFwp4SyNrIuR0mfcuxsoTG+pVOzEX9CIFy8rufzdwD/89WNJ/ WtzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=y26lG3IQPjlC/R+8bNRiEMV5jgx1MPx3j5Q0rbOjDXw=; b=lC1zIEkC9Oeiix61HBmsQfLTFPY2O/LoKn+fUFJgBxra9K0hUPbIJUuMZyqcUMOa8c QgtrkLvwbXr1c2pq10wwuMhHYlbj0af/7CjiI7EJNJFo3WNMDvwU+f0yk0R92ZwKHwH7 mHfkwpGTj/mlxlqgV/b/e4ouX4jVOHJnbF0/6qY2h/t+Ssy3ujYC4iU0jI5h2a8BbwZO QwoFb3ahgfS0WffvXexkWZj4ha3xJw+apTSJh0FQ8hMNvtx7j9FtXgnZLTYv5f/AYWJS Gib6EIIkVe36a9qBjS7zn9IkolYwg3tSc7PKqZoJcBs8Put60Xd2FZ2O8G3TTml75rN0 B6Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uW+exXsX; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j9-20020a05640211c900b00454c2c7f37csi4402910edw.101.2022.09.21.21.23.13; Wed, 21 Sep 2022 21:23:57 -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=@kernel.org header.s=k20201202 header.b=uW+exXsX; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229523AbiIVETK (ORCPT + 63 others); Thu, 22 Sep 2022 00:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230247AbiIVETG (ORCPT ); Thu, 22 Sep 2022 00:19:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35995A221B; Wed, 21 Sep 2022 21:19:05 -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 C0F2D62FAD; Thu, 22 Sep 2022 04:19:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C3BEC433D6; Thu, 22 Sep 2022 04:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663820344; bh=8xodEWMTndBecZO1JG0sANGtdcIZJhdCKz1ZoOkxjMk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=uW+exXsXSGrew87ZojaTnnu2Pv1UtGXzQqjjLX2b7oGph4+PQelJUJX11FgjpqatQ ELoqv5pR8bSV3/7535PDpBw6BVY4bi59s4BaKlJSIYVXzNRY6aDLmLKhJLPFtzieTO iB7297vU052/FKz0Dc21FYTixE1ykO1VrtaDUUK3SkYuK3biSXS0J7OKhhQjo/eWra 7mj2sPUPAmfSHWCc1MV6VYkGtcRnMWzr/LNBb6lPibVdaMWLqUzHsztksp0W4hjZYv zIN6846mujkb0CwMdnKoomN+OWU5pYCeMqp4QWw7CJvtecSieKja+ya7GWiRyAj90B 2nqT/vaz2aB1w== From: Kalle Valo To: Kees Cook Cc: Vlastimil Babka , Gregory Greenman , Johannes Berg , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Greg Kroah-Hartman , Nick Desaulniers , Alex Elder , Josef Bacik , David Sterba , Sumit Semwal , Christian =?utf-8?Q?K=C3=B6nig?= , Jesse Brandeburg , Daniel Micay , Yonghong Song , Marco Elver , Miguel Ojeda , Jacob Shin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-btrfs@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-fsdevel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, dev@openvswitch.org, x86@kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org Subject: Re: [PATCH 10/12] iwlwifi: Track scan_cmd allocation size explicitly References: <20220922031013.2150682-1-keescook@chromium.org> <20220922031013.2150682-11-keescook@chromium.org> Date: Thu, 22 Sep 2022 07:18:51 +0300 In-Reply-To: <20220922031013.2150682-11-keescook@chromium.org> (Kees Cook's message of "Wed, 21 Sep 2022 20:10:11 -0700") Message-ID: <87fsgk6nys.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Kees Cook writes: > In preparation for reducing the use of ksize(), explicitly track the > size of scan_cmd allocations. This also allows for noticing if the scan > size changes unexpectedly. Note that using ksize() was already incorrect > here, in the sense that ksize() would not match the actual allocation > size, which would trigger future run-time allocation bounds checking. > (In other words, memset() may know how large scan_cmd was allocated for, > but ksize() will return the upper bounds of the actually allocated memory, > causing a run-time warning about an overflow.) > > Cc: Gregory Greenman > Cc: Kalle Valo > Cc: Johannes Berg > Cc: linux-wireless@vger.kernel.org > Cc: netdev@vger.kernel.org > Signed-off-by: Kees Cook Via which tree is this iwlwifi patch going? Normally via wireless-next or something else? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches