Skip to content

Commit

Permalink
af_unix: fix struct pid memory leak
Browse files Browse the repository at this point in the history
Dmitry reported a struct pid leak detected by a syzkaller program.

Bug happens in unix_stream_recvmsg() when we break the loop when a
signal is pending, without properly releasing scm.

Fixes: b3ca9b0 ("net: fix multithreaded signal handling in unix recv routines")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and davem330 committed Jan 25, 2016
1 parent 4877be9 commit fa0dc04
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/unix/af_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -2339,6 +2339,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state)

if (signal_pending(current)) {
err = sock_intr_errno(timeo);
scm_destroy(&scm);
goto out;
}

Expand Down

0 comments on commit fa0dc04

Please sign in to comment.