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 0FEF4C6FA90 for ; Thu, 22 Sep 2022 05:26:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbiIVF0c (ORCPT ); Thu, 22 Sep 2022 01:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbiIVF0b (ORCPT ); Thu, 22 Sep 2022 01:26:31 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7039AA1D26 for ; Wed, 21 Sep 2022 22:26:29 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 3so8086394pga.1 for ; Wed, 21 Sep 2022 22:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=1AAj0jz/3WOf/ZinmBg4e5WZyKIExnDIP+4ApRXDWXk=; b=E6vw8sjIHY/i68R43dGnMLa/5LLUaNZd7XsoFQWcc3w5wUJdtXNsxsEfsPht7kxdNG JJ1tXBTf3XQqnlgOex/RZ+o0XMhSMgfcjsVoIr6koV6H3KyiaZ1lUXPNyODzP4yferwZ bLRSqfuB8yrx2QNr5YGtL8EgG0hPZHJq7V7xk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=1AAj0jz/3WOf/ZinmBg4e5WZyKIExnDIP+4ApRXDWXk=; b=X7sMBDUGvQQMo20zhbRBqoi4eoSy42i++/No4sI8RdD2feptmI5XCO85VnxpBM6hsg PEY5SJgQ0/ltlA5zx7DRrvdHYYicKhD4eOo67s4Tzz+xiI85/gBKBx0kSD0lTwAasRsX bcpDRFGEz1L+wdALjkN91mv0jlhU21Wf1uhWQfb22JJMCcTM1szOqU8BPkiD1HeWHTET R+Uc/plfFGl2teA0aE9ZUN3wS7P/embf42lID8J2sdMYV1vMwcN16OABpcNca/kmIzGe ETpoPRrrgX+9GYKUOsEZS8CymyvYc86hfMuN30FTqH7pbFtlLJWSQRLFMq/bP8j9AfDn 8XCw== X-Gm-Message-State: ACrzQf3Vt84VcfgwYkk+kbwxhCqS86TBQG8JE6D5YGM0jA9J8Q0Zo7/v 9HtLyIwStCrCjiqP9ODeGH6hPQ== X-Google-Smtp-Source: AMsMyM4a+GHcnQt0UeqKstHRefYZ2pfi5aegxBG+GRLeLtm77LwF22DDWI605QZJjTDKHxZFsdcd6w== X-Received: by 2002:a63:cf56:0:b0:439:41ed:78fc with SMTP id b22-20020a63cf56000000b0043941ed78fcmr1597609pgj.419.1663824388949; Wed, 21 Sep 2022 22:26:28 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l10-20020a170903120a00b0016f196209c9sm3102876plh.123.2022.09.21.22.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 22:26:28 -0700 (PDT) Date: Wed, 21 Sep 2022 22:26:27 -0700 From: Kees Cook To: Kalle Valo 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 =?iso-8859-1?Q?K=F6nig?= , 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 Message-ID: <202209212224.A2F1DB798@keescook> References: <20220922031013.2150682-1-keescook@chromium.org> <20220922031013.2150682-11-keescook@chromium.org> <87fsgk6nys.fsf@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fsgk6nys.fsf@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Thu, Sep 22, 2022 at 07:18:51AM +0300, Kalle Valo wrote: > 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? This doesn't depend on the kmalloc_size_roundup() helper at all, so I would be happy for it to go via wireless-next if the patch seems reasonable. -- Kees Cook