From patchwork Tue Jan 20 02:47:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 5662301 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 248F99F358 for ; Tue, 20 Jan 2015 02:47:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43E0920328 for ; Tue, 20 Jan 2015 02:47:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74072202DD for ; Tue, 20 Jan 2015 02:47:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751453AbbATCrc (ORCPT ); Mon, 19 Jan 2015 21:47:32 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:40537 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267AbbATCrb (ORCPT ); Mon, 19 Jan 2015 21:47:31 -0500 Received: by mail-pa0-f49.google.com with SMTP id hz1so11911864pad.8 for ; Mon, 19 Jan 2015 18:47:31 -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:in-reply-to:references; bh=WPNpe+31ZWXLbx2pr79D5+0g4hRykcm2YqpokRIEqSU=; b=ya2jT/m7OEeDY+misRa0Qz3yJCpLl1vkr4sNc3m/j3756K9rhOjv69XSCTaOF5TQH/ midRbwlE/RvsQyAzFe+PnDapc6ZR3vl9Ly2N6d0n9/nTw1D5Ahqi8wdipsU5Dlr4imBb 6D6SDSCggEBXWT0D08L0F1/iBqlyRZayU+7nZowq/gwzcdXtuKdKgnK/tG+9dLCA0XoS IDJJ7s9TNvZ9udgU5Yb+4dp9+ZWtcRoQI0+l97ru32jOu5mCH4dTsxkyANtHZnpJPmnC QTDnc7gjhAJUjtorpD8goYa285gDhUxUG4I52cc5FX0b0Mu03rYoSj1YTV/foAbdjUl5 ME/g== X-Received: by 10.66.121.132 with SMTP id lk4mr23450558pab.33.1421722051066; Mon, 19 Jan 2015 18:47:31 -0800 (PST) Received: from localhost.localdomain (pda6e63a4.kngwnt01.ap.so-net.ne.jp. [218.110.99.164]) by mx.google.com with ESMTPSA id bx13sm12972036pdb.19.2015.01.19.18.47.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Jan 2015 18:47:30 -0800 (PST) From: Masashi Honma To: linux-wireless@vger.kernel.org Cc: me@bobcopeland.com, Masashi Honma Subject: [PATCH v3] mac80211: Avoid STA expiration timer truncation to u32 Date: Tue, 20 Jan 2015 11:47:03 +0900 Message-Id: <1421722023-4691-1-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On some combination of plink_timeout and HZ, the STA expiration timer will be unexpectedly truncated to u32. Maybe there is a question "Who sets such a large number to plink_timeout ?". At least wpa_supplicant will set 0xffffffff to plink_timeout to disable this timer because wpa_supplicant has it's own expiration mechanism. Signed-off-by: Masashi Honma --- net/mac80211/mesh.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 0c8b2a7..3c40894 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -573,8 +573,11 @@ static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata) { struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; u32 changed; + u64 exp_time; - ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ); + exp_time = ifmsh->mshcfg.plink_timeout * (u64)HZ; + if (exp_time < 0x100000000) + ieee80211_sta_expire(sdata, exp_time); mesh_path_expire(sdata); changed = mesh_accept_plinks_update(sdata);