From patchwork Tue Jun 19 15:39:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 10474741 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E420F60383 for ; Tue, 19 Jun 2018 15:40:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6A0A28E76 for ; Tue, 19 Jun 2018 15:40:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA08F28E78; Tue, 19 Jun 2018 15:40:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DC3C28E76 for ; Tue, 19 Jun 2018 15:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966800AbeFSPj6 (ORCPT ); Tue, 19 Jun 2018 11:39:58 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:38909 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966534AbeFSPj4 (ORCPT ); Tue, 19 Jun 2018 11:39:56 -0400 Received: by mail-ot0-f196.google.com with SMTP id p95-v6so158176ota.5 for ; Tue, 19 Jun 2018 08:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=dSM+oKDdQWWwYQjljF+0v/oFUz/bZRb1cbfz3N7SoZ4=; b=vPV9JZ0KdNUEpFeD2LRMrx+W3sFrVhrMQy314fi5SOoKAVuP9u26c23jTqPaEK480W nrueYiuqtX7dcKAB771NXT95+skLlzWwsHx3W7SJ3Mwp9LU4HA/Z98GAYJgQt+TIEonk rQC14Up9MK+4HlqVoq+I67uW+/Lxo06Qa83lVPJOUuBfy2MS8xUqj/20vqTsRV0ztaxU vPUs75wQdxE5u3x/mgmdlfVFBuN2xfS+lO8C45COl48HDbo5K+9ar8jeF7TRI4il9HQx QGe5SELA4wox9Q74ZeoKA7XRcEzWn2wjsFyjHdB1c9fWynInQbt2HFWXU7oAy7gEnpgS w8sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dSM+oKDdQWWwYQjljF+0v/oFUz/bZRb1cbfz3N7SoZ4=; b=bWLQksEo4XKMCitB2VZ2kxZzdIkhsMXGGfkp5vZzJfrlz0HFZ5HwLl+eoXCCFfS5Jj GeqMeO9qDY4NT0+0G5CTNR0RKsXgOP4alsk6312hNVtB4atQHs6a5h93vhjs47XjGmX+ I+5qFCi1japwIAfM524yAwN9gv1OtHOLAJG5kwKDtMD39wf7KB2o4kykwTTv59MSebOL hq2ienqWQyrDyMFO1kjKnUz7fAJ4RqXt2lW4LATG6LeT5HRS0E00Jtn4DzKs+B7ET4Lf RgkgS1Ym7foT9ew8vmX8jv06WS1xkUPJvSRsXCevZwOtHT77ESElXxnj4cq6YeKtEVrv s+DQ== X-Gm-Message-State: APt69E05Y7oIRnMbpq/1fZtHdc7JeXbke4pbiywlGfMHpOXQqCBvIJmA Yr1FIQBrfzQFhIgvElgmIQdwMw== X-Google-Smtp-Source: ADUXVKIDJEokktC040aqdZfPLrqy15hlk3Wn9pF7VtpUm393UQiiwkXzrkYhyHSLmmrZ+bL/lPgA5Q== X-Received: by 2002:a9d:f07:: with SMTP id 7-v6mr10001257ott.347.1529422796058; Tue, 19 Jun 2018 08:39:56 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id s22-v6sm3369ote.14.2018.06.19.08.39.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jun 2018 08:39:55 -0700 (PDT) From: Denis Kenzior To: linux-wireless@vger.kernel.org, johannes@sipsolutions.net Cc: Denis Kenzior Subject: [PATCH] mac80211: Fix oops in ieee80211_tx_control_port Date: Tue, 19 Jun 2018 10:39:50 -0500 Message-Id: <20180619153950.28903-1-denkenz@gmail.com> X-Mailer: git-send-email 2.13.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On pre-emption enabled kernels the following oops was being seen due to missing local_bh_disable/local_bh_enable calls. mac80211 assumes that pre-emption is disabled in the data path. [ 5365.229756] Call Trace: [ 5365.229762] dump_stack+0x5c/0x80 [ 5365.229766] check_preemption_disabled.cold.0+0x46/0x51 [ 5365.229779] __ieee80211_subif_start_xmit+0x144/0x210 [mac80211] [ 5365.229790] ieee80211_tx_control_port+0x116/0x140 [mac80211] [ 5365.229806] nl80211_tx_control_port+0x13c/0x270 [cfg80211] [ 5365.229810] genl_family_rcv_msg+0x1c4/0x3a0 [ 5365.229814] ? nlmon_xmit+0x3c/0x50 [nlmon] [ 5365.229816] ? dev_hard_start_xmit+0xa5/0x240 [ 5365.229817] genl_rcv_msg+0x47/0x90 [ 5365.229818] ? genl_family_rcv_msg+0x3a0/0x3a0 [ 5365.229820] netlink_rcv_skb+0x4c/0x120 [ 5365.229821] genl_rcv+0x24/0x40 [ 5365.229822] netlink_unicast+0x196/0x240 [ 5365.229824] netlink_sendmsg+0x1fd/0x3c0 [ 5365.229826] sock_sendmsg+0x33/0x40 [ 5365.229827] __sys_sendto+0xee/0x160 [ 5365.229830] ? __se_sys_epoll_ctl+0x34d/0xe80 [ 5365.229831] ? do_epoll_wait+0xb0/0xd0 [ 5365.229832] __x64_sys_sendto+0x24/0x30 [ 5365.229835] do_syscall_64+0x5b/0x170 [ 5365.229836] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: Denis Kenzior --- net/mac80211/tx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 5b93bde248fd..6a79d564de35 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -4850,7 +4850,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, skb_reset_network_header(skb); skb_reset_mac_header(skb); + local_bh_disable(); __ieee80211_subif_start_xmit(skb, skb->dev, flags); + local_bh_enable(); return 0; }