From patchwork Tue Nov 27 15:47:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 1811651 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id BB405DF254 for ; Tue, 27 Nov 2012 15:47:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755813Ab2K0Pr3 (ORCPT ); Tue, 27 Nov 2012 10:47:29 -0500 Received: from mail-wg0-f44.google.com ([74.125.82.44]:62434 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755442Ab2K0Pr2 (ORCPT ); Tue, 27 Nov 2012 10:47:28 -0500 Received: by mail-wg0-f44.google.com with SMTP id dr13so2973168wgb.1 for ; Tue, 27 Nov 2012 07:47:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=rss55dck9YXlJWX5nOJW6kN2ld/QfguZIlMBKmXBlbI=; b=lkVErS61zcCBmgiXpWHij1/H9MkjG5blwPc8HFqrJXEsXgPS7/yxdri+6L3RryAyaC 09Nm+h+Lzk9CLdGj8oeM9PHCbGkUu1lPR97b1YpO5+rTxGfcTNTYn6q9/0SH3drzUPyb SqK5pibD0mMf5LOZfZ5E4pPUc3mnManJEoUt9ktmqY71ljAcXHbmHqO0LonsKHYUmYO1 rQOtV9RDC6LJ/Y4efwOqv1k9iDd8a2y2CJUL1gGFkIuZIYBDSV8dmvQlLrft8vvKMgob 2L4dIHwkNPgGuHKzVOLObqXY/YaOJxlfNmf7oIH4E4UtgBwV/HhKgd4UQ0cVbPaPqUT2 fnQw== Received: by 10.216.29.138 with SMTP id i10mr4449183wea.36.1354031247263; Tue, 27 Nov 2012 07:47:27 -0800 (PST) Received: from localhost.localdomain (port-92-198-130-130.static.qsc.de. [92.198.130.130]) by mx.google.com with ESMTPS id i6sm3021769wix.5.2012.11.27.07.47.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Nov 2012 07:47:26 -0800 (PST) From: Helmut Schaa To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, sgruszka@redhat.com, gwingerde@gmail.com, IvDoorn@gmail.com, Helmut Schaa Subject: [PATCH] rt2x00: Use addr_mask to catch invalid MAC addresses Date: Tue, 27 Nov 2012 16:47:16 +0100 Message-Id: <1354031236-8191-1-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.7.7 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This ensures that a user cannot accidentally set up a virtual interface with a MAC address the rt2800 hw cannot handle. Reported-by: Petr Stetiar Signed-off-by: Helmut Schaa --- drivers/net/wireless/rt2x00/rt2800lib.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index c0441a7..7f0df12 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c @@ -5108,6 +5108,9 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0)); + /* Only the last three bits are variable in rt2800 devices. */ + rt2x00dev->hw->wiphy->addr_mask[ETH_ALEN - 1] = 0x7; + /* * As rt2800 has a global fallback table we cannot specify * more then one tx rate per frame but since the hw will