diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2016-02-02 12:17:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-07 14:06:26 -0500 |
commit | 3575dbf2cbbc8e598f17ec441aed526dbea0e1bd (patch) | |
tree | 8dac5377390bc6c58d30abf40b2eeb51573549a5 /net/unix | |
parent | 67eb03318bc5fe170ae832423fda7a23b0d801cf (diff) |
net: drop write-only stack variable
Remove a write-only stack variable from unix_attach_fds(). This is a
left-over from the security fix in:
commit 712f4aad406bb1ed67f3f98d04c044191f0ff593
Author: willy tarreau <w@1wt.eu>
Date: Sun Jan 10 07:54:56 2016 +0100
unix: properly account for FDs passed over unix sockets
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 49d5093eb055..b3745557fc89 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1534,7 +1534,6 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb) | |||
1534 | { | 1534 | { |
1535 | int i; | 1535 | int i; |
1536 | unsigned char max_level = 0; | 1536 | unsigned char max_level = 0; |
1537 | int unix_sock_count = 0; | ||
1538 | 1537 | ||
1539 | if (too_many_unix_fds(current)) | 1538 | if (too_many_unix_fds(current)) |
1540 | return -ETOOMANYREFS; | 1539 | return -ETOOMANYREFS; |
@@ -1542,11 +1541,9 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb) | |||
1542 | for (i = scm->fp->count - 1; i >= 0; i--) { | 1541 | for (i = scm->fp->count - 1; i >= 0; i--) { |
1543 | struct sock *sk = unix_get_socket(scm->fp->fp[i]); | 1542 | struct sock *sk = unix_get_socket(scm->fp->fp[i]); |
1544 | 1543 | ||
1545 | if (sk) { | 1544 | if (sk) |
1546 | unix_sock_count++; | ||
1547 | max_level = max(max_level, | 1545 | max_level = max(max_level, |
1548 | unix_sk(sk)->recursion_level); | 1546 | unix_sk(sk)->recursion_level); |
1549 | } | ||
1550 | } | 1547 | } |
1551 | if (unlikely(max_level > MAX_RECURSION_LEVEL)) | 1548 | if (unlikely(max_level > MAX_RECURSION_LEVEL)) |
1552 | return -ETOOMANYREFS; | 1549 | return -ETOOMANYREFS; |