Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2873483ybv; Mon, 24 Feb 2020 13:24:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxPgvNjysQq7bzQCs/nji4QOwivHaJvpe28fj/dHCAooSHn7AK9qU0oPBUtnKcFZ2GWsalq X-Received: by 2002:a05:6808:9b4:: with SMTP id e20mr826634oig.37.1582579443457; Mon, 24 Feb 2020 13:24:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582579443; cv=none; d=google.com; s=arc-20160816; b=JSp3/NEbEhMJ5AHqAJQelIVsDKa3ohPuh/v1CerSn7NSOEnZHbTKC26KSwqiTzxOVF StywH3/qI4kpOQBdDYMKYSU9oyyxBcGwhg+G0Ntu3ag1OAZDZ0W7Aqz/cnu+ncdMXJqS RkFlIq80yRjyCJvnv+ehK/60Hj8hT6NsqUYvkhRxToYlqCaZ5wzyYxFljF+SfsfF2hPf 1w53CTb2fWDHFEP5tLUir/UWNgT91x558qybaq9pwN8e+El/wGfVzo/29ihz3tyOM+n3 f26QExteGf2zDP/05AJqZbKShcgG6GUThRhDkoQEYr6OOUVMJ9V7FJ8WUi0TZeISAB3S lxog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=VUYVa63hAyIvPxdNpP7mGYzS6hoFUy0m3tzN/wTzrLI=; b=pZZixTZG9z1+GzBwhz1gt2BoejrcS2/WaBU5EBu0WD1amQa45wEGp6lQyASX+YsKGR 28K3b8kRvsxSJjpR+PgVIrv1UZ43C86TdKSscVsxB4ZPufhR5R/1ahXE4sWEQZ3GZau7 K1em0k8JS55Ec1t2sel+QfFNqXBCprW8w49XN+DX9XUpxe21z2mcnJg1ty0vH3rJ3LDh C2fb5z8Z1AOmSrajDcSRrDa/2UQiGDNhvsheN0EjRciaChyQWll3xknDQMApXqsDAchW MFkAvmVDYdyzoHH3uzKSn0OTYGuLvXFdTFbFf4XbnPHSSRfw/EyjW9XfZOVD0rvOFm4Q qI/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 y144si5859112oia.67.2020.02.24.13.23.40; Mon, 24 Feb 2020 13:24:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726980AbgBXVVs (ORCPT + 99 others); Mon, 24 Feb 2020 16:21:48 -0500 Received: from s3.sipsolutions.net ([144.76.43.62]:47154 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbgBXVVr (ORCPT ); Mon, 24 Feb 2020 16:21:47 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1j6LAb-007kiD-DX; Mon, 24 Feb 2020 22:21:41 +0100 Message-ID: Subject: Re: [PATCH v4 6/7] rtw88: Add wowlan pattern match support From: Johannes Berg To: Brian Norris , yhchuang@realtek.com Cc: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, chiu@endlessm.com Date: Mon, 24 Feb 2020 22:21:40 +0100 In-Reply-To: <20200222005242.GA100360@google.com> (sfid-20200222_015250_208812_578FC10C) References: <20191219085816.20709-1-yhchuang@realtek.com> <20191219085816.20709-7-yhchuang@realtek.com> <20200222005242.GA100360@google.com> (sfid-20200222_015250_208812_578FC10C) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 (3.34.2-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Brian, > > + if (is_broadcast_ether_addr(pattern)) > > I'm pretty sure it's not valid to look at 'pkt_pattern->pattern' without > also accounting for the ->mask. Same for all the other if/else here. Indeed, I'm not even sure what we fill in there. Perhaps whatever userspace happened to have there, including potentially uninitialized data? > This also hints at a deficiency in the wowlan APIs: nl80211_set_wowlan() > only honors a pre-set set of restrictions, like min/max pattern length, > max offset. For restrictions like this, we either need a wiphy callback, > such that rtw88 can reject arbitrary patterns, or else some additional > declarative fields in 'struct wiphy_wowlan_support'. Yeah, well, we didn't dream up arbitrary restrictions when the API was added :-) It's maybe a bit harder now to add them, but we can do it in cfg80211, and reject it if the conditions are not met, and then older userspace will simply not be able to figure out easily why it was rejected, if it doesn't understand some new features bits/capability advertisement, I guess? I guess I'm not a huge fan of just arbitrarily returning errors when something went wrong and userspace cannot figure out why (vs. advertised restrictions like what we have now), but I guess that'd still be better than nothing ... Ideally, this can just be fixed; if not, IMHO better to add some advertisement bits, but if not then we can surely add some kind of filter callback that's invoked at config time, rather than only at suspend time when it's way too late to do anything about it. johannes