Commit c8f7244
tcp: tcp_child_process() related UAF
tcp_child_process( .. child ...) currently calls sock_put(child).
Unfortunately @child (named @nsk in callers) can be used after
this point to send a RST packet.
To fix this UAF, I remove the sock_put() from tcp_child_process()
and let the callers handle this after it is safe.
Remove @rsk variable in tcp_v4_do_rcv() and change tcp_v6_do_rcv()
so that both functions look the same.
Fixes: cfb6eeb ("[TCP]: MD5 Signature Option (RFC2385) support.")
Reported-by: Damiano Melotti <melotti@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260505153927.3435532-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 770b136 commit c8f7244
3 files changed
Lines changed: 15 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1827 | 1827 | | |
1828 | 1828 | | |
1829 | 1829 | | |
1830 | | - | |
1831 | 1830 | | |
1832 | 1831 | | |
1833 | 1832 | | |
| |||
1863 | 1862 | | |
1864 | 1863 | | |
1865 | 1864 | | |
1866 | | - | |
1867 | | - | |
| 1865 | + | |
| 1866 | + | |
1868 | 1867 | | |
1869 | | - | |
1870 | 1868 | | |
1871 | 1869 | | |
1872 | 1870 | | |
1873 | 1871 | | |
1874 | 1872 | | |
1875 | 1873 | | |
1876 | | - | |
1877 | | - | |
| 1874 | + | |
1878 | 1875 | | |
1879 | | - | |
1880 | 1876 | | |
1881 | 1877 | | |
1882 | 1878 | | |
1883 | | - | |
| 1879 | + | |
1884 | 1880 | | |
1885 | 1881 | | |
1886 | 1882 | | |
| |||
2193 | 2189 | | |
2194 | 2190 | | |
2195 | 2191 | | |
| 2192 | + | |
2196 | 2193 | | |
2197 | 2194 | | |
| 2195 | + | |
2198 | 2196 | | |
2199 | 2197 | | |
2200 | 2198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
1015 | | - | |
| 1015 | + | |
1016 | 1016 | | |
1017 | 1017 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1617 | 1617 | | |
1618 | 1618 | | |
1619 | 1619 | | |
| 1620 | + | |
| 1621 | + | |
1620 | 1622 | | |
1621 | | - | |
1622 | | - | |
1623 | | - | |
1624 | | - | |
1625 | | - | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
1626 | 1627 | | |
1627 | 1628 | | |
1628 | 1629 | | |
| |||
1827 | 1828 | | |
1828 | 1829 | | |
1829 | 1830 | | |
| 1831 | + | |
1830 | 1832 | | |
1831 | 1833 | | |
| 1834 | + | |
1832 | 1835 | | |
1833 | 1836 | | |
1834 | 1837 | | |
| |||
0 commit comments