Commit dd66185
wifi: wilc1000: add missing read critical sections around vif list traversal
Some code manipulating the vif list is still missing some srcu_read_lock /
srcu_read_unlock, and so can trigger RCU warnings:
=============================
WARNING: suspicious RCU usage
6.8.0-rc1+ #37 Not tainted
-----------------------------
drivers/net/wireless/microchip/wilc1000/hif.c:110 RCU-list traversed without holding the required lock!!
[...]
stack backtrace:
CPU: 0 PID: 6 Comm: kworker/0:0 Not tainted 6.8.0-rc1+ #37
Hardware name: Atmel SAMA5
Workqueue: events sdio_irq_work
unwind_backtrace from show_stack+0x18/0x1c
show_stack from dump_stack_lvl+0x34/0x58
dump_stack_lvl from wilc_get_vif_from_idx+0x158/0x180
wilc_get_vif_from_idx from wilc_network_info_received+0x80/0x48c
wilc_network_info_received from wilc_handle_isr+0xa10/0xd30
wilc_handle_isr from wilc_sdio_interrupt+0x44/0x58
wilc_sdio_interrupt from process_sdio_pending_irqs+0x1c8/0x60c
process_sdio_pending_irqs from sdio_irq_work+0x6c/0x14c
sdio_irq_work from process_one_work+0x8d4/0x169c
process_one_work from worker_thread+0x8cc/0x1340
worker_thread from kthread+0x448/0x510
kthread from ret_from_fork+0x14/0x28
Fix those warnings by adding the needed lock around the corresponding
critical sections
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Co-developed-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240215-wilc_fix_rcu_usage-v1-4-f610e46c6f82@bootlin.com1 parent 51e4aa8 commit dd66185
2 files changed
+35
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1570 | 1570 | | |
1571 | 1571 | | |
1572 | 1572 | | |
| 1573 | + | |
1573 | 1574 | | |
1574 | 1575 | | |
1575 | 1576 | | |
1576 | 1577 | | |
| 1578 | + | |
1577 | 1579 | | |
1578 | 1580 | | |
1579 | | - | |
1580 | | - | |
| 1581 | + | |
1581 | 1582 | | |
| 1583 | + | |
1582 | 1584 | | |
1583 | 1585 | | |
1584 | | - | |
| 1586 | + | |
1585 | 1587 | | |
1586 | 1588 | | |
1587 | 1589 | | |
1588 | 1590 | | |
1589 | | - | |
| 1591 | + | |
1590 | 1592 | | |
1591 | 1593 | | |
1592 | 1594 | | |
| |||
1595 | 1597 | | |
1596 | 1598 | | |
1597 | 1599 | | |
1598 | | - | |
| 1600 | + | |
1599 | 1601 | | |
1600 | 1602 | | |
1601 | 1603 | | |
| |||
1604 | 1606 | | |
1605 | 1607 | | |
1606 | 1608 | | |
| 1609 | + | |
| 1610 | + | |
1607 | 1611 | | |
1608 | 1612 | | |
1609 | 1613 | | |
1610 | 1614 | | |
1611 | 1615 | | |
1612 | 1616 | | |
1613 | 1617 | | |
| 1618 | + | |
1614 | 1619 | | |
1615 | 1620 | | |
1616 | 1621 | | |
1617 | 1622 | | |
1618 | 1623 | | |
1619 | 1624 | | |
| 1625 | + | |
1620 | 1626 | | |
1621 | | - | |
1622 | | - | |
1623 | | - | |
1624 | | - | |
| 1627 | + | |
| 1628 | + | |
1625 | 1629 | | |
1626 | 1630 | | |
1627 | 1631 | | |
1628 | 1632 | | |
1629 | | - | |
1630 | | - | |
| 1633 | + | |
1631 | 1634 | | |
1632 | 1635 | | |
1633 | 1636 | | |
1634 | 1637 | | |
1635 | | - | |
1636 | | - | |
| 1638 | + | |
1637 | 1639 | | |
1638 | 1640 | | |
1639 | 1641 | | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
| 1642 | + | |
| 1643 | + | |
1644 | 1644 | | |
1645 | 1645 | | |
1646 | 1646 | | |
1647 | 1647 | | |
1648 | 1648 | | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | | - | |
| 1651 | + | |
| 1652 | + | |
1652 | 1653 | | |
1653 | 1654 | | |
1654 | 1655 | | |
1655 | 1656 | | |
1656 | 1657 | | |
1657 | 1658 | | |
1658 | 1659 | | |
| 1660 | + | |
1659 | 1661 | | |
1660 | 1662 | | |
1661 | 1663 | | |
1662 | 1664 | | |
| 1665 | + | |
1663 | 1666 | | |
1664 | 1667 | | |
1665 | | - | |
1666 | | - | |
| 1668 | + | |
1667 | 1669 | | |
1668 | | - | |
1669 | | - | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
1670 | 1674 | | |
1671 | 1675 | | |
1672 | 1676 | | |
1673 | 1677 | | |
1674 | 1678 | | |
1675 | 1679 | | |
1676 | | - | |
| 1680 | + | |
1677 | 1681 | | |
1678 | 1682 | | |
1679 | 1683 | | |
| |||
1682 | 1686 | | |
1683 | 1687 | | |
1684 | 1688 | | |
| 1689 | + | |
| 1690 | + | |
1685 | 1691 | | |
1686 | 1692 | | |
1687 | 1693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
| 822 | + | |
822 | 823 | | |
823 | 824 | | |
824 | 825 | | |
825 | 826 | | |
826 | 827 | | |
| 828 | + | |
827 | 829 | | |
828 | 830 | | |
829 | | - | |
| 831 | + | |
830 | 832 | | |
831 | 833 | | |
832 | 834 | | |
| |||
837 | 839 | | |
838 | 840 | | |
839 | 841 | | |
840 | | - | |
| 842 | + | |
841 | 843 | | |
842 | 844 | | |
843 | 845 | | |
| |||
850 | 852 | | |
851 | 853 | | |
852 | 854 | | |
| 855 | + | |
| 856 | + | |
853 | 857 | | |
854 | 858 | | |
855 | 859 | | |
| |||
0 commit comments