Skip to content

Commit

Permalink
net: drop write-only stack variable
Browse files Browse the repository at this point in the history
Remove a write-only stack variable from unix_attach_fds(). This is a
left-over from the security fix in:

    commit 712f4aa
    Author: willy tarreau <[email protected]>
    Date:   Sun Jan 10 07:54:56 2016 +0100

        unix: properly account for FDs passed over unix sockets

Signed-off-by: David Herrmann <[email protected]>
Acked-by: Hannes Frederic Sowa <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
David Herrmann authored and davem330 committed Feb 7, 2016
1 parent 67eb033 commit 3575dbf
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/unix/af_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,19 +1534,16 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
{
int i;
unsigned char max_level = 0;
int unix_sock_count = 0;

if (too_many_unix_fds(current))
return -ETOOMANYREFS;

for (i = scm->fp->count - 1; i >= 0; i--) {
struct sock *sk = unix_get_socket(scm->fp->fp[i]);

if (sk) {
unix_sock_count++;
if (sk)
max_level = max(max_level,
unix_sk(sk)->recursion_level);
}
}
if (unlikely(max_level > MAX_RECURSION_LEVEL))
return -ETOOMANYREFS;
Expand Down

0 comments on commit 3575dbf

Please sign in to comment.