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 712f4aad40
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>
This commit is contained in:
parent
67eb03318b
commit
3575dbf2cb
|
@ -1534,7 +1534,6 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned char max_level = 0;
|
unsigned char max_level = 0;
|
||||||
int unix_sock_count = 0;
|
|
||||||
|
|
||||||
if (too_many_unix_fds(current))
|
if (too_many_unix_fds(current))
|
||||||
return -ETOOMANYREFS;
|
return -ETOOMANYREFS;
|
||||||
|
@ -1542,12 +1541,10 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
|
||||||
for (i = scm->fp->count - 1; i >= 0; i--) {
|
for (i = scm->fp->count - 1; i >= 0; i--) {
|
||||||
struct sock *sk = unix_get_socket(scm->fp->fp[i]);
|
struct sock *sk = unix_get_socket(scm->fp->fp[i]);
|
||||||
|
|
||||||
if (sk) {
|
if (sk)
|
||||||
unix_sock_count++;
|
|
||||||
max_level = max(max_level,
|
max_level = max(max_level,
|
||||||
unix_sk(sk)->recursion_level);
|
unix_sk(sk)->recursion_level);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (unlikely(max_level > MAX_RECURSION_LEVEL))
|
if (unlikely(max_level > MAX_RECURSION_LEVEL))
|
||||||
return -ETOOMANYREFS;
|
return -ETOOMANYREFS;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue