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 0398FC07E9D for ; Mon, 26 Sep 2022 08:03:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233485AbiIZIDo (ORCPT ); Mon, 26 Sep 2022 04:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234186AbiIZICn (ORCPT ); Mon, 26 Sep 2022 04:02:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 077C6167C2; Mon, 26 Sep 2022 01:00:02 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6E967B8191D; Mon, 26 Sep 2022 08:00:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15004C433C1; Mon, 26 Sep 2022 07:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664179199; bh=BKaJB74cTuefD7ABjII+u7AOgXdfZ6IIrKwYO+YFiwA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Hyc7Yt4JMRaV93ujZXcbA6K75iKsTxLlkmSgCVt36DaZp09gGDnmN4EJbeayeQ/qN 3jEp8KLozDsB5an81OOeR7jhTN01D7/6umcHN2nNtowRyX35dtCAQ1JDHTjuEn9ULL oV6buTY/Pjh1znzJxLvS71sf46j3L57ogNSxUesw9iGcpVHQsL42CAtv1Z3RnZbW/b wtR6XNhWhaxNVau5wCZto1o8qodSKDM+Z7JI7nMB1jSI9rSqql3wOZYycygUYlXKZH GQNLjqJ66xRAjmjKK8LN9zfpa2pje/YYTyfFmuy955aTcDQUZ9Q9L5IscH5qYVfdnj yWy6pOoZhiNcw== From: Kalle Valo To: Kees Cook Cc: Gregory Greenman , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Luca Coelho , Johannes Berg , Emmanuel Grumbach , Miri Korenblit , Ilan Peer , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Nathan Errera , Mordechay Goodstein , Mike Golant , Ayala Beker , Avraham Stern , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2] iwlwifi: Track scan_cmd allocation size explicitly References: <20220923220853.3302056-1-keescook@chromium.org> Date: Mon, 26 Sep 2022 10:59:52 +0300 In-Reply-To: <20220923220853.3302056-1-keescook@chromium.org> (Kees Cook's message of "Fri, 23 Sep 2022 15:08:53 -0700") Message-ID: <874jwu4lc7.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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: "David S. Miller" > Cc: Eric Dumazet > Cc: Jakub Kicinski > Cc: Paolo Abeni > Cc: Luca Coelho > Cc: Johannes Berg > Cc: Emmanuel Grumbach > Cc: Miri Korenblit > Cc: Ilan Peer > Cc: linux-wireless@vger.kernel.org > Cc: netdev@vger.kernel.org > Signed-off-by: Kees Cook Gregory, can I take this directly to wireless-next? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches