Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3701719imm; Mon, 18 Jun 2018 02:35:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJahGklhvF+C8DMBGtphtkys3u28+4x+NtesGSUuYkhS4/vJLSmNN1NkThTxVPH6riTIsHd X-Received: by 2002:a65:5143:: with SMTP id g3-v6mr10269207pgq.190.1529314513887; Mon, 18 Jun 2018 02:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529314513; cv=none; d=google.com; s=arc-20160816; b=lmJBfXWFvVHKUH4OKmXmX8AKoes6XgCVZXSIalUkrx5KAfKos/EiXSdVKmHXCWN0Yb PLmChH1J389Trh5+2PMYYaJJUlCkAg2BVu1D2DJWRQR8Od7TqvY6RQaGArVr0cEn1VPB NbgEU8nf+IYjx16JFixCGuJveYqxXG2SAM6dQNJf3mQV9f0Uu70yN0gnN1Dw1TQ0Do2F HLMPzEDGbc4p3rBMQ0s8nzExPyqhs6bVGq1YDVs7EwgoaSXM4Ow1siQdR3nzfUs0hJhR jNJY0WReWGj10B5X1K0ZFtp5BbX3lCo/jaX2juNDSL3rAztqljit/ML3RwPouUyXdapH BjVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=4mtAsIjfuMoaBMUQHlY9uLFhLQtZZmNyh+GNHXANECg=; b=Di/3oXNSCPQI2pgd52i9vA4qvArDLEDRbj83WHsZswNXYiNkBloOdXN9hxf8dIt/c0 FCHdEvHoh1+LJNWmx+q40qNpboFYAqjQmqu0Wch77jQTIzQPDheXtkV0XuETHLtOpljH 1xgElPcP/AkXV9oORFYuoX4x6KdPbFzP7dvFtUJu0U95C9YocCPWAl4omm7BdPMFa8tS DzRteB6Zhx5ie5QJ0ffTmEV/UuA7PhZwEiEYiwJcDIJp4J0nEV/fk80QbE46VHG+2cNT j4RKRK78tLUyezzYGpTtbbx+IzcHJDoQrRuOsZ5JfqjVxdWiAnyEQwgpgGwGiNr3EEGZ qHkQ== ARC-Authentication-Results: i=1; mx.google.com; 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 p8-v6si12128100pgs.239.2018.06.18.02.35.00; Mon, 18 Jun 2018 02:35:13 -0700 (PDT) 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; 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 S936052AbeFRIYL (ORCPT + 99 others); Mon, 18 Jun 2018 04:24:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55948 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936039AbeFRIYI (ORCPT ); Mon, 18 Jun 2018 04:24:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9BB77BAD; Mon, 18 Jun 2018 08:24:07 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilan Peer , Luca Coelho , Johannes Berg , Sasha Levin Subject: [PATCH 4.16 190/279] mac80211: Adjust SAE authentication timeout Date: Mon, 18 Jun 2018 10:12:55 +0200 Message-Id: <20180618080616.786646674@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ilan Peer [ Upstream commit 407879b690ba3a6bf29be896d02dad63463bd1c0 ] The IEEE P802.11-REVmd D1.0 specification updated the SAE authentication timeout to be 2000 milliseconds (see dot11RSNASAERetransPeriod). Update the SAE timeout setting accordingly. While at it, reduce some code duplication in the timeout configuration. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/mac80211/mlme.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -35,6 +35,7 @@ #define IEEE80211_AUTH_TIMEOUT (HZ / 5) #define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2) #define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10) +#define IEEE80211_AUTH_TIMEOUT_SAE (HZ * 2) #define IEEE80211_AUTH_MAX_TRIES 3 #define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5) #define IEEE80211_ASSOC_TIMEOUT (HZ / 5) @@ -3788,16 +3789,19 @@ static int ieee80211_auth(struct ieee802 tx_flags); if (tx_flags == 0) { - auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; - auth_data->timeout_started = true; - run_again(sdata, auth_data->timeout); + if (auth_data->algorithm == WLAN_AUTH_SAE) + auth_data->timeout = jiffies + + IEEE80211_AUTH_TIMEOUT_SAE; + else + auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; } else { auth_data->timeout = round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG); - auth_data->timeout_started = true; - run_again(sdata, auth_data->timeout); } + auth_data->timeout_started = true; + run_again(sdata, auth_data->timeout); + return 0; } @@ -3868,8 +3872,15 @@ void ieee80211_sta_work(struct ieee80211 ifmgd->status_received = false; if (ifmgd->auth_data && ieee80211_is_auth(fc)) { if (status_acked) { - ifmgd->auth_data->timeout = - jiffies + IEEE80211_AUTH_TIMEOUT_SHORT; + if (ifmgd->auth_data->algorithm == + WLAN_AUTH_SAE) + ifmgd->auth_data->timeout = + jiffies + + IEEE80211_AUTH_TIMEOUT_SAE; + else + ifmgd->auth_data->timeout = + jiffies + + IEEE80211_AUTH_TIMEOUT_SHORT; run_again(sdata, ifmgd->auth_data->timeout); } else { ifmgd->auth_data->timeout = jiffies - 1;