Commit 62dba28
atm: clip: Fix memory leak of struct clip_vcc.
ioctl(ATMARP_MKIP) allocates struct clip_vcc and set it to
vcc->user_back.
The code assumes that vcc_destroy_socket() passes NULL skb
to vcc->push() when the socket is close()d, and then clip_push()
frees clip_vcc.
However, ioctl(ATMARPD_CTRL) sets NULL to vcc->push() in
atm_init_atmarp(), resulting in memory leak.
Let's serialise two ioctl() by lock_sock() and check vcc->push()
in atm_init_atmarp() to prevent memleak.
Fixes: 1da177e ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250704062416.1613927-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 706cc36 commit 62dba28
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
648 | 651 | | |
649 | 652 | | |
650 | 653 | | |
| |||
669 | 672 | | |
670 | 673 | | |
671 | 674 | | |
| 675 | + | |
672 | 676 | | |
673 | 677 | | |
674 | 678 | | |
| |||
689 | 693 | | |
690 | 694 | | |
691 | 695 | | |
| 696 | + | |
692 | 697 | | |
693 | 698 | | |
694 | 699 | | |
695 | 700 | | |
696 | 701 | | |
| 702 | + | |
697 | 703 | | |
698 | 704 | | |
| 705 | + | |
699 | 706 | | |
| 707 | + | |
700 | 708 | | |
701 | 709 | | |
702 | 710 | | |
| |||
0 commit comments