In the Linux kernel, the following vulnerability has been resolved:
atm: clip: Fix memory leak of struct clip_vcc.
ioctl(ATMARPMKIP) allocates struct clipvcc and set it to vcc->user_back.
The code assumes that vccdestroysocket() passes NULL skb to vcc->push() when the socket is close()d, and then clippush() frees clipvcc.
However, ioctl(ATMARPDCTRL) sets NULL to vcc->push() in atminit_atmarp(), resulting in memory leak.
Let's serialise two ioctl() by locksock() and check vcc->push() in atminit_atmarp() to prevent memleak.