From patchwork Fri Jan 16 06:18:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 5645701 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 44406C058D for ; Fri, 16 Jan 2015 06:19:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A38720120 for ; Fri, 16 Jan 2015 06:19:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0ED0620115 for ; Fri, 16 Jan 2015 06:19:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751503AbbAPGSz (ORCPT ); Fri, 16 Jan 2015 01:18:55 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:64141 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751467AbbAPGSy (ORCPT ); Fri, 16 Jan 2015 01:18:54 -0500 Received: by mail-pa0-f48.google.com with SMTP id rd3so22323671pab.7 for ; Thu, 15 Jan 2015 22:18:54 -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=kwt4jbG5uJyscq6xBUed1SKlpFrQlb9HE7d32QGJ1s8=; b=ldC1ACKuiOZuQ16xaE2Z5B1nPKRkWER9eT91ZOKl64rrZqIKVtEl5KsEpLFDzlsbgi sGTuxaC70FKI86HuuDumarjk+pqShD3sONmO10S3IF/4SchAtAi6g7HZrLimtiiwvMQO zEJljgv6kCBjH4NYzrPl4uLHeUS7VL9yfOblazGoHSU8qIigeak6U0HF8npTv+mvnYxQ oFujXeQ10NvG9r8QNWWTP7xKXTbmRI29fFLGggzek2uXHB+cFAER4TwQGAPxyyvNHNns pp+T51/8G/Yk48VR/yunEAIXL/xVul0lie7ZT10q0akMnJuOxJfnidyVM/zvxTqrCa0Z Jmzw== X-Received: by 10.70.22.208 with SMTP id g16mr19626987pdf.141.1421389134320; Thu, 15 Jan 2015 22:18:54 -0800 (PST) Received: from localhost.localdomain (pdf867c5e.kngwnt01.ap.so-net.ne.jp. [223.134.124.94]) by mx.google.com with ESMTPSA id w3sm3055295pdw.14.2015.01.15.22.18.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jan 2015 22:18:53 -0800 (PST) From: Masashi Honma To: linux-wireless@vger.kernel.org Cc: me@bobcopeland.com, Masashi Honma Subject: [PATCH v2] mac80211: Avoid STA expiration timer truncation to u32 Date: Fri, 16 Jan 2015 15:18:41 +0900 Message-Id: <1421389121-2841-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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 0c8b2a7..bb721a0 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -574,7 +574,8 @@ static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata) struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; u32 changed; - ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ); + ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * + (unsigned long)HZ); mesh_path_expire(sdata); changed = mesh_accept_plinks_update(sdata);