lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 13 Jul 2021 18:46:20 +0200
From:   Johannes Berg <johannes@...solutions.net>
To:     Felix Fietkau <nbd@....name>, linux-wireless@...r.kernel.org
Cc:     netdev@...r.kernel.org, pablo@...filter.org, ryder.lee@...iatek.com
Subject: Re: [RFC 1/7] mac80211: add support for .ndo_fill_forward_path

On Tue, 2021-07-13 at 18:07 +0200, Felix Fietkau wrote:
> +
> +static int ieee80211_netdev_fill_forward_path(struct net_device_path_ctx *ctx,
> +					      struct net_device_path *path)
> +{
> +	struct ieee80211_sub_if_data *sdata;
> +	struct ieee80211_local *local;
> +	struct sta_info *sta;
> +	int ret = -ENOENT;
> +
> +	sdata = IEEE80211_DEV_TO_SUB_IF(ctx->dev);
> +	local = sdata->local;
> +
> +	if (!local->ops->net_fill_forward_path)
> +		return -EOPNOTSUPP;
> +
> +	rcu_read_lock();
> +	switch (sdata->vif.type) {
> +	case NL80211_IFTYPE_AP_VLAN:
> +		sta = rcu_dereference(sdata->u.vlan.sta);
> +		if (sta)
> +			break;
> +		if (!sdata->wdev.use_4addr)
> +			goto out;

Am I confusing things, or is this condition inverted? If it's not 4-addr
then you won't have a u.vlan.sta, but you might still want to look up
the station more generally, no?

> +		fallthrough;
> +	case NL80211_IFTYPE_AP:
> +		if (is_multicast_ether_addr(ctx->daddr))
> +			goto out;
> +		sta = sta_info_get_bss(sdata, ctx->daddr);

Or maybe this shouldn't use _bss() here, but then you'd need to write a
sta_info_get() also in the VLAN case, no?

Which might actually be better or even correct, because if the station
is on the VLAN you probably *don't* want to find it here if the
interface that's being passed is the AP, no?

johannes

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ