mac80211: fix typo in starting baserate for rts_cts_rate_idx
Karl Beldan authored
commit c7abf25a upstream.

It affects non-(V)HT rates and can lead to selecting an rts_cts rate
that is not a basic rate or way superior to the reference rate (ATM
rates[0] used for the 1st attempt of the protected frame data).

E.g, assuming drivers register growing (bitrate) sorted tables of
ieee80211_rate-s, having :
- rates[0].idx == d'2 and basic_rates == b'10100
will select rts_cts idx b'10011 & ~d'(BIT(2)-1), i.e. 1, likewise
- rates[0].idx == d'2 and basic_rates == b'10001
will select rts_cts idx b'10000
The first is not a basic rate and the second is > rates[0].

Also, wrt severity of the addressed misbehavior, ATM we only have one
rts_cts_rate_idx rather than one per rate table entry, so this idx might
still point to bitrates > rates[1..MAX_RATES].

Fixes: 5253ffb8

 ("mac80211: always pick a basic rate to tx RTS/CTS for pre-HT rates")
Signed-off-by: default avatarKarl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
94f13cde
Name Last commit Last update
..
802 mrp: add periodictimer to allow retries when packets get lost
8021q net: Always untag vlan-tagged traffic on input.
9p 9p/trans_virtio.c: Fix broken zero-copy on vmalloc() buffers
appletalk appletalk: Fix socket referencing in skb
atm net: rework recvmsg handler msg_name and msg_namelen logic
ax25 net: rework recvmsg handler msg_name and msg_namelen logic
batman-adv batman-adv: increase orig refcount when storing ref in gw_node
bluetooth Bluetooth: Avoid use of session socket after the session gets freed
bridge bridge: Fix br_should_learn to check vlan_enabled
caif net: rework recvmsg handler msg_name and msg_namelen logic
can net: Use netlink_ns_capable to verify the permisions of netlink messages
ceph libceph: ceph-msgr workqueue needs a resque worker
core net: fix checksum features handling in netif_skb_features()
dcb net: Use netlink_ns_capable to verify the permisions of netlink messages
dccp net:dccp: do not report ICMP redirects to user space
decnet net: Use netlink_ns_capable to verify the permisions of netlink messages
dns_resolver dns_resolver: assure that dns_query() result is null-terminated
dsa net: dsa: inherit addr_assign_type along with dev_addr
ethernet net: Fix sysfs_format_mac() code duplication.
ieee802154 6lowpan: fix lockdep splats
ipv4 ipv4: dst_entry leak in ip_send_unicast_reply()
ipv6 drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets
ipx net: rework recvmsg handler msg_name and msg_namelen logic
irda net: rework recvmsg handler msg_name and msg_namelen logic
iucv af_iucv: wrong mapping of sent and confirmed skbs
key
l2tp
lapb
llc
mac80211
mac802154
mpls
netfilter
netlabel
netlink
netrom
nfc
openvswitch
packet
phonet
rds
rfkill
rose
rxrpc
sched
sctp
sunrpc
tipc
unix
vmw_vsock
wimax
wireless
x25
xfrm
Kconfig
Makefile
compat.c
nonet.c
socket.c
sysctl_net.c