Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp557879pxb; Fri, 13 Aug 2021 00:47:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+gMYkPbm3HFbpt/2dnMzbtXQuN/2MlUeDm4Ta7xdwH1L0nasMlX3RO1TSH/r1dcoDY9Kk X-Received: by 2002:a02:a619:: with SMTP id c25mr1073243jam.1.1628840856270; Fri, 13 Aug 2021 00:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628840856; cv=none; d=google.com; s=arc-20160816; b=oUBCaAJHfeqyyE6WbGPIGFMfJMplbWGxo9GGCWwb8pk9A2y0lkigeQiHSIld9kekTt VRP4dQcnFARJB6YsXlNDTKpVGUBHhz/IaRSw8DOq1PENyQVTaGwiG2W8JO+s4y9eYEAl FZks6ZwLig6D75WDYy3Ye7tnARWcrRBPllXG7/Fjl5eJd0XxDlto+8FxrfKuVn8Tu4sy B/7b6zhGJq5T2LTK4jmgxRh1eHOpe6QJVvTPp0LCUmHHaZBpnWI9XpSkV1uxYkUNRZ9r pFjdYToeJM3E9lhC2yyX5GOYBkU9WA09qLNZPKjwzgmxve687wewukqCRH6LeSjMeY8r v3Gw== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=v5GvruCHAD5VdGVp7rPAa70pStcYZ0dgf5ANMBb+4wc=; b=eBUUKnZoH6enci5jlNegiV/2j417Fc+X97Qchrg2lDyhUnsMlop4gHycxa4WaKWmtm 1cWHu0Hais/43Ba8Qm/TIWih06TKtbSLC7eGA3W+1M94OXzpTZ/uHvt+98oVduxh0PJ+ fAssSYA7hww3cGYiYbJ8mxWTs2O6bz+7ZJo0S9ke/o8HFGr5ZVOpG8h3H3u3j3RGlKS6 OkArgC2mk2KZe28CTL5FStwenUMbAAQ0tvFOmQXhsZfLiwRrORuL2YkYfjEoeOvyS2Ys W57191AjMncTcGLjXkjKBnLXSD+SzFmrer+hSo2ptlCDw8wS4WrXSC++2IBZf+/7a3QD gnXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=ZFr3C2+x; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e128si847512jac.31.2021.08.13.00.47.24; Fri, 13 Aug 2021 00:47:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=ZFr3C2+x; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239600AbhHMHm3 (ORCPT + 99 others); Fri, 13 Aug 2021 03:42:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239590AbhHMHm3 (ORCPT ); Fri, 13 Aug 2021 03:42:29 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93FCEC061756; Fri, 13 Aug 2021 00:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=v5GvruCHAD5VdGVp7rPAa70pStcYZ0dgf5ANMBb+4wc=; t=1628840522; x=1630050122; b=ZFr3C2+x1UejITvtIoKSlKqWMYfmd05UvxUUYJmP8dCuqZf xyL7kJF2m31ZbzvXMxn0Qfo/LsIdqEv+uDFADyYhkZH/gq1wVfAYpfvvHz0euyfwDe4RouS03or0e dhM0p+QuyBPDtIGV/IMKk1eKz1XNqmGv+GvQfUkGGjKbUrsOm2gJYmA2ysm9KYtgwfby3qUVcH8sl Em7NK+clrwAnkRPjbj1+yEyh6lQteTdvCAFF8IgnmzxiwzICRKC0V7EKQwyQx3nhr6bgSbitEHW5S L0dfMV1v8YGd5+WQxoBO0iPtQJn5nzXhREzUcX2n0+AZqqvEooJKIpQ+7q6elHMA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1mERoz-00A937-Sm; Fri, 13 Aug 2021 09:41:42 +0200 Message-ID: <347234b097eb93a0882ad2a3a209c2b7923ff611.camel@sipsolutions.net> Subject: Re: [PATCH 39/64] mac80211: Use memset_after() to clear tx status From: Johannes Berg To: Kees Cook , "David S. Miller" , Jakub Kicinski Cc: "Gustavo A. R. Silva" , Keith Packard , Greg Kroah-Hartman , Andrew Morton , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-staging@lists.linux.dev, linux-block@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, linux-hardening@vger.kernel.org Date: Fri, 13 Aug 2021 09:41:40 +0200 In-Reply-To: <202107310852.551B66EE32@keescook> References: <20210727205855.411487-1-keescook@chromium.org> <20210727205855.411487-40-keescook@chromium.org> <202107310852.551B66EE32@keescook> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sat, 2021-07-31 at 08:55 -0700, Kees Cook wrote: > > > @@ -278,9 +278,7 @@ static void carl9170_tx_release(struct kref *ref) > >   BUILD_BUG_ON( > >   offsetof(struct ieee80211_tx_info, status.ack_signal) != 20); > >   > > > > - memset(&txinfo->status.ack_signal, 0, > > - sizeof(struct ieee80211_tx_info) - > > - offsetof(struct ieee80211_tx_info, status.ack_signal)); > > + memset_after(&txinfo->status, 0, rates); FWIW, I think we should also remove the BUILD_BUG_ON() now in all the places - that was meant to give people a hint to update if some field ordering etc. changed, but now that it's "after rates" this is no longer necessary. johannes