Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2461225imj; Mon, 18 Feb 2019 06:26:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IbT7l9DVa/tyDpraQhXb0KngG0Apahz7bvSHG+BTHxU2LDXu1eE+i4WibZ6qarB/uwnxRY0 X-Received: by 2002:a17:902:d708:: with SMTP id w8mr25931343ply.294.1550499991893; Mon, 18 Feb 2019 06:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550499991; cv=none; d=google.com; s=arc-20160816; b=RGeVElRDyQIsPZxGcMOelUT+l5LaFo8ryE/Njs9Z1Yqa2V5P/Tlx9i7JWk6eBN9qrl EtOpLm9YEu8m1g4KarTwj3He6lSFVoRA7adwRty4dzw5qyw5D8WxMP+CaiZAkCsk/peO qPLY/Z+lIXKCm6vk7sjqaklfYFju1XMkvTjqsP4aVk89EUbi6RLMWqGmiA1Tr+ojlnD2 vOK9cyBuYYmPijkQrb39877DFxW38fV2QIbd36I+gNYe467vzGqdVCNP+14o6nkrAEt/ dcS9fgHTj4B3rtWMStiO+BJV2SlIDcrjFd5W6Y5ctgiyqRsGLTUcU/yOwlS8VL3a4Aay B91A== 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=EWakOCOsT7nCXzIAmns/643bc71PKw5bh+3+XsEtM/A=; b=G1yuhA09kiY0VU6JM7d/cCsjbeY/FlYHlPSIKDGQwto0bCiiuMPw4cxO7wlaqGVpl5 H53GhkPaYRC/T9tEt6rPpjdKDe1jM/aL5m8UjdzNYt2x0q0PiG8ThR1dPaLJf5eMmynO RQVPFlZXxsfOIEeGX9AdxTtZCtIH+qoAPx41Urw7q8N6WiFJTW+tIzaQ0+/Qm8YrHoNf UgA7EKoSouBiCApMOn5LZi1I7c7PCx96zYk4sqG5u9kcPUet0EaIj1i8An+/hWEtkaGR qU3sontn3tLuzvExRJYZJFsrH5hRtU8rlYzjunxnkhikqBQ8ZAx8WW4Tv7IIavytsee+ V1Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HhoR46z4; 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 d186si949871pfg.50.2019.02.18.06.26.16; Mon, 18 Feb 2019 06:26:31 -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=HhoR46z4; 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 S2390210AbfBROYK (ORCPT + 99 others); Mon, 18 Feb 2019 09:24:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:46456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389860AbfBROEF (ORCPT ); Mon, 18 Feb 2019 09:04:05 -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 A7A5E20643; Mon, 18 Feb 2019 14:04:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498644; bh=tg63zNs+wbs/kk1TbXXWQ895a6+V2hWcWhczaDzVw/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HhoR46z4M7Dgr8h2DsqjH70M1AV4PotgQ0GibPDGblwc3MALNCKCLILT6FaY/YAQg Cf0cFIpBSWQMPyu0k9vhAk+JJYqIRbHY+79ktY7K6rVD4ARStRdcbSF4v3PS6o12Us b4Vszmbi4P4u8GORw6juKRwtUHXnqjkeTdhmc/6Y= 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.4 042/143] mac80211: fix radiotap vendor presence bitmap handling Date: Mon, 18 Feb 2019 14:42:50 +0100 Message-Id: <20190218133530.682683787@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133529.099444112@linuxfoundation.org> References: <20190218133529.099444112@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.4-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 64f76f88f819..acacceec8cd8 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -149,6 +149,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); @@ -185,8 +188,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