Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2756728imj; Mon, 11 Feb 2019 08:02:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ04kQRwU/wsxzRqh6Bc/EaWQ/xrAqGHBUCw1tI14BVeo34j20C/Q6w/eKyWmyE7GN2pihm X-Received: by 2002:a63:cf4b:: with SMTP id b11mr34639524pgj.405.1549900947104; Mon, 11 Feb 2019 08:02:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900947; cv=none; d=google.com; s=arc-20160816; b=ua04frNpKNHKLQqRTb+ePSqb5yICY6Mu57axZ4sQnnXFmp8nqmBE6HifU94gLhUp+j Ao2A7b5BvJRmZ3EHvCN+QXdPKwvXAhWSoSLLwf2b1dZ6/FGHkutbiaqKVJx4Rn7SUS4x 8HnyUt43wNR7z4KhQBEcwv1j0lZkdSOxz+ZnLfm+76VqVEL2yqEAZc1lQjk/LYRLwXj0 CANrtdnrFTZdfop1ZsBkcOLydskKtrtFcqP/+xwyaep0J6mLoz+SURg1OL9UEAIN1lFz Jz23bolXHMHXiB0jCfZfDjSDIqSGAXcswwPFvqEVUAsOQnA2Lwt8vYcmYcCP0SstKzjs nMVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8fZ7D58PbTucwlBmP9sF0NUh5lInMQ1MBygSRvq8dQs=; b=N2BGto6kJOFiCq4Z+YPpiqZk0GpfyKridLy3aG52d2Aluf/eOQWvFcBk9VdaWe/j/a EmWQ5w6zMPr+wSysgJ9s7cdBtioKMQz0an5dQXsfw/mFITblMk1uL8TR0Ttzoy6bLPPO jEnTtsN29OY+tNjdl5mP19M/HeXm2/r0PN542dx1uLgTNuCD3jXoZok1RdQ04htyyHLV QgOluuk01hsh+c68aSXeLQQC4zb6Tpp1zq0CNKsabN2UZwFNePWfArT2Ykyy1g1qYC1K QJrklRSES4gt0gmxENRknC+6u18kPlu3raloKvbZG0rCs75uxCODp0adLTghunVnzJvG DmwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ltX5yspr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15si9077075pff.206.2019.02.11.08.02.08; Mon, 11 Feb 2019 08:02:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ltX5yspr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730287AbfBKObW (ORCPT + 99 others); Mon, 11 Feb 2019 09:31:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:38140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730283AbfBKObT (ORCPT ); Mon, 11 Feb 2019 09:31:19 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B901A20675; Mon, 11 Feb 2019 14:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895479; bh=nzv003LsRn6uxE2b7H7TryLMaD1kugpmpTl9qFGYBRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ltX5ysproSl8682QKl+0rNXcRABSI2ecYn5G27s+hFZo0c1VabtjkUzT7xlEb64w7 Dbqxb9t/LLh6tHTM9CxO379x99jLn/lret/YF2cy8JRFjN2C80C7XPC6cfr8P3JCkQ FY8l/FOMnRw7/udLchRDcC2uA+x7Wf+By+VDu7Sc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Luca Coelho , Sasha Levin Subject: [PATCH 4.20 211/352] mac80211: fix radiotap vendor presence bitmap handling Date: Mon, 11 Feb 2019 15:17:18 +0100 Message-Id: <20190211141900.616042876@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit efc38dd7d5fa5c8cdd0c917c5d00947aa0539443 ] Due to the alignment handling, it actually matters where in the code we add the 4 bytes for the presence bitmap to the length; the first field is the timestamp with 8 byte alignment so we need to add the space for the extra vendor namespace presence bitmap *before* we do any alignment for the fields. Move the presence bitmap length accounting to the right place to fix the alignment for the data properly. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/rx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 77d996a60f12..85c365fc7a0c 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -143,6 +143,9 @@ ieee80211_rx_radiotap_hdrlen(struct ieee80211_local *local, /* allocate extra bitmaps */ if (status->chains) len += 4 * hweight8(status->chains); + /* vendor presence bitmap */ + if (status->flag & RX_FLAG_RADIOTAP_VENDOR_DATA) + len += 4; if (ieee80211_have_rx_timestamp(status)) { len = ALIGN(len, 8); @@ -207,8 +210,6 @@ ieee80211_rx_radiotap_hdrlen(struct ieee80211_local *local, if (status->flag & RX_FLAG_RADIOTAP_VENDOR_DATA) { struct ieee80211_vendor_radiotap *rtap = (void *)skb->data; - /* vendor presence bitmap */ - len += 4; /* alignment for fixed 6-byte vendor data header */ len = ALIGN(len, 2); /* vendor data header */ -- 2.19.1