Commit 22701a3
ipv6: mcast: Don't hold RTNL for MCAST_ socket options.
JIRA: https://issues.redhat.com/browse/RHEL-115325
commit e6e14d5
Author: Kuniyuki Iwashima <kuniyu@google.com>
Date: Wed Jul 2 16:01:26 2025 -0700
ipv6: mcast: Don't hold RTNL for MCAST_ socket options.
In ip6_mc_source() and ip6_mc_msfilter(), per-socket mld data is
protected by lock_sock() and inet6_dev->mc_lock is also held for
some per-interface functions.
ip6_mc_find_dev_rtnl() only depends on RTNL. If we want to remove
it, we need to check inet6_dev->dead under mc_lock to close the race
with addrconf_ifdown(), as mentioned earlier.
Let's do that and drop RTNL for the rest of MCAST_ socket options.
Note that ip6_mc_msfilter() has unnecessary lock dances and they
are integrated into one to avoid the last-minute error and simplify
the error handling.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250702230210.3115355-10-kuni1840@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>1 parent bc53b02 commit 22701a3
2 files changed
+45
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | 126 | | |
132 | 127 | | |
133 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | | - | |
307 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
315 | 317 | | |
316 | | - | |
| 318 | + | |
| 319 | + | |
317 | 320 | | |
318 | 321 | | |
| 322 | + | |
319 | 323 | | |
320 | | - | |
| 324 | + | |
321 | 325 | | |
322 | | - | |
323 | 326 | | |
324 | 327 | | |
325 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
326 | 332 | | |
327 | 333 | | |
328 | | - | |
329 | | - | |
| 334 | + | |
330 | 335 | | |
331 | 336 | | |
332 | 337 | | |
| |||
354 | 359 | | |
355 | 360 | | |
356 | 361 | | |
357 | | - | |
| 362 | + | |
358 | 363 | | |
| 364 | + | |
359 | 365 | | |
| 366 | + | |
360 | 367 | | |
361 | | - | |
362 | | - | |
363 | 368 | | |
364 | | - | |
365 | | - | |
| 369 | + | |
366 | 370 | | |
| 371 | + | |
367 | 372 | | |
368 | 373 | | |
369 | 374 | | |
| |||
372 | 377 | | |
373 | 378 | | |
374 | 379 | | |
375 | | - | |
| 380 | + | |
376 | 381 | | |
377 | 382 | | |
378 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
379 | 391 | | |
380 | 392 | | |
381 | | - | |
382 | 393 | | |
383 | 394 | | |
384 | 395 | | |
| |||
475 | 486 | | |
476 | 487 | | |
477 | 488 | | |
| 489 | + | |
478 | 490 | | |
479 | 491 | | |
480 | 492 | | |
| |||
483 | 495 | | |
484 | 496 | | |
485 | 497 | | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | 498 | | |
490 | 499 | | |
491 | 500 | | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
492 | 504 | | |
493 | 505 | | |
494 | 506 | | |
| |||
500 | 512 | | |
501 | 513 | | |
502 | 514 | | |
503 | | - | |
| 515 | + | |
504 | 516 | | |
505 | 517 | | |
506 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
507 | 526 | | |
508 | 527 | | |
509 | 528 | | |
| |||
536 | 555 | | |
537 | 556 | | |
538 | 557 | | |
539 | | - | |
| 558 | + | |
540 | 559 | | |
541 | 560 | | |
542 | 561 | | |
543 | | - | |
544 | 562 | | |
545 | 563 | | |
546 | 564 | | |
547 | 565 | | |
548 | | - | |
549 | 566 | | |
550 | 567 | | |
551 | | - | |
552 | 568 | | |
553 | | - | |
554 | 569 | | |
555 | 570 | | |
556 | | - | |
557 | 571 | | |
558 | 572 | | |
559 | 573 | | |
| |||
563 | 577 | | |
564 | 578 | | |
565 | 579 | | |
| 580 | + | |
566 | 581 | | |
567 | | - | |
568 | 582 | | |
569 | 583 | | |
570 | 584 | | |
571 | 585 | | |
| 586 | + | |
| 587 | + | |
572 | 588 | | |
573 | 589 | | |
574 | 590 | | |
| |||
0 commit comments