Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2683861imj; Mon, 11 Feb 2019 07:00:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IZEA2JfSXVAcUqUwSps+dKtth5FdlytVnAiCDECyPCp9UERns/24Trs+NAA7VUh9TQfsgZw X-Received: by 2002:a63:ce0e:: with SMTP id y14mr34208590pgf.145.1549897238053; Mon, 11 Feb 2019 07:00:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897238; cv=none; d=google.com; s=arc-20160816; b=vSY1gTLOgio9WV3c2ckB7A5bBt0SUe9xF6AcJvdgpPde5mdJCljZpU5yblpiXUt9VS 8rtA6pR060dfjMisgMmKZvMt0WvBKa78soFBbKUmUQJldHeG5c3vYpyr52f2FHmL9LAJ ipDdcrbY6PzFmyFffbSx26xrpsaH81iJYUTwE0XZMqmmLE9dqEFNq3rlx6qeiEmf7xVp icA6+J/OAAGI/OHXG3d2b6EsNUg6DE06ErnjG3fBK9ed5T9BcdrRXGssBqw0qjaTWNdj jdI3M6OTmxs9YiDsSKMCEEHCfLPTAhvRmC+J+tIFA5/8Z3zkl2MliDjcHRQBMK4JxnyJ 8aVw== 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=o1xYFsvHKx4woRKg1cLRfhQmuDJOcGgxoEowIYWC5Kw=; b=RnY6dsA1+SgXzXHLXWHZcJcwmj/9R8KvJhms9nIAIr4lO/8o0C2hpengyFwPJTXwyW 5yBbNZ0Gv0cIeeF8mFry4qOJNvMKuC32oDbbs5vVDLss4qgOTUCEcMg6Llry+5MeSxvR D3+3L1jlwFSgOrwUCofYU4SgJN1d2G2vjMiRfvk6gAoPRetMgCVBsYkPZnY4fXfSM/iR 26V8GBCjBsKKBvm0yTbLJzmdrsajaULI67GtIuX9k772OEfo5Zv2ULvAa1Pt1P2GJLbK MTBnCbKw/+l+NobGDIQUn2IqdHjie1hQ3zn6LhUbHq+ZVWuFKcYWkbzPRDn+G/eiUc6P DZ9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=brHvOpyf; 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 l24si9627982pgj.171.2019.02.11.07.00.21; Mon, 11 Feb 2019 07:00:38 -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=brHvOpyf; 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 S2389794AbfBKO7X (ORCPT + 99 others); Mon, 11 Feb 2019 09:59:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:47056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389742AbfBKO7S (ORCPT ); Mon, 11 Feb 2019 09:59:18 -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 84150206BA; Mon, 11 Feb 2019 14:59:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897158; bh=GBhFM5vbTQl7D/ihm1dfBJ0b63r0qcX35NCBbGf1zwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=brHvOpyfA88dNT1kOHDTIT3cda9RE2vAAhQ8Z3Z3Il8tlb2HfwEiZyVx+n02+JwTe t827sVwBOZu1Vc+bT/lPwhZhsd05XovwOwSb3fogcFGuYDdgcJnbVNZXeSJ2NBeOmk MWHHrRTqwuJjuvXylLamCXOKLyNAXa2sapYrY6Po= 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.14 109/205] mac80211: fix radiotap vendor presence bitmap handling Date: Mon, 11 Feb 2019 15:18:27 +0100 Message-Id: <20190211141835.663894608@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 9e19ddbcb06e..c7ac1a480b1d 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -141,6 +141,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); @@ -182,8 +185,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