Commit 8ff047b
committed
wifi: cfg80211: clarify and tighten key checks
Currently, we accept per-STA GTK for any interface type
if the IBSS_RSN flag is set, which doesn't make sense,
and also accept various key indices that aren't really
(meant to be) supported, such as IGTK/BIGTK on IBSS or
AP_VLAN etc.
For MESH and NAN_DATA interface types, per-STA GTKs are
required, so their support shouldn't depend on IBSS_RSN.
Conversely a driver setting IBSS_RSN doesn't really say
it also accepts per-STA GTK for other interface types.
Move more checks into cfg80211_valid_key_idx() and make
them more precise:
- allow IGTK and, if supported, BIGTK for NAN
- allow per-STA (RX) GTK only for
- NAN_DATA
- IBSS if IBSS_RSN is supported
- MESH
- allow B/I/GTK for station/P2P-client without mac_addr
for RX with the current AP (historic API quirk),
subject to support
- allow TX GTK for AP/P2P-GO/AP_VLAN
- allow TX IGTK/BIGTK for AP/P2P-GO subject to support
Other settings are rejected, clearing up corner cases
and disallowing unexpected settings.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260715212403.725e6b63e890.I24684374112bb94d0633d61ef76ecb8a1517f7f1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>1 parent 3002812 commit 8ff047b
4 files changed
Lines changed: 86 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
447 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
448 | 449 | | |
449 | 450 | | |
450 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5409 | 5409 | | |
5410 | 5410 | | |
5411 | 5411 | | |
5412 | | - | |
| 5412 | + | |
5413 | 5413 | | |
5414 | 5414 | | |
5415 | 5415 | | |
| |||
5663 | 5663 | | |
5664 | 5664 | | |
5665 | 5665 | | |
5666 | | - | |
5667 | | - | |
| 5666 | + | |
| 5667 | + | |
| 5668 | + | |
5668 | 5669 | | |
5669 | 5670 | | |
5670 | 5671 | | |
5671 | 5672 | | |
5672 | 5673 | | |
5673 | 5674 | | |
5674 | 5675 | | |
5675 | | - | |
5676 | | - | |
5677 | | - | |
5678 | | - | |
5679 | 5676 | | |
5680 | 5677 | | |
5681 | 5678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
| 244 | + | |
246 | 245 | | |
247 | | - | |
248 | 246 | | |
249 | 247 | | |
250 | 248 | | |
| |||
260 | 258 | | |
261 | 259 | | |
262 | 260 | | |
263 | | - | |
264 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
265 | 264 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
| 265 | + | |
| 266 | + | |
279 | 267 | | |
280 | | - | |
| 268 | + | |
281 | 269 | | |
282 | 270 | | |
283 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
284 | 341 | | |
285 | 342 | | |
286 | 343 | | |
287 | 344 | | |
288 | 345 | | |
289 | 346 | | |
290 | 347 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 348 | + | |
298 | 349 | | |
299 | 350 | | |
300 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
458 | | - | |
| 457 | + | |
459 | 458 | | |
460 | 459 | | |
461 | 460 | | |
| |||
0 commit comments