[PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure

Subsystems: networking [general], networking [sockets], the rest

STALE4668d REVIEWED: 4 (4M)

1 review trailer (1 from subsystem maintainers).

2 messages, 2 authors, 2013-10-23 · open the first message on its own page

[PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure

From: Eric W. Biederman <hidden>
Date: 2013-10-23 19:55:34

From: Christoph Paasch <redacted>
Date: Wed, 23 Oct 2013 12:49:21 -0700

2e685cad57 (tcp_memcontrol: Kill struct tcp_memcontrol) falsly modified
the access to memory_pressure of sk->sk_prot->memory_pressure. The patch
did modify the memory_pressure-field of struct cg_proto, but not the one
of struct proto.

So, the access to sk_prot->memory_pressure should not be changed.

Acked-by: Eric Dumazet <edumazet@google.com>
Reported-by: Fengguang Wu <redacted>
Signed-off-by: Christoph Paasch <redacted>
Signed-off-by: Eric W. Biederman <redacted>
---
 include/net/sock.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index c93542f92420..e3a18ff0c38b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1137,7 +1137,7 @@ static inline bool sk_under_memory_pressure(const struct sock *sk)
 	if (mem_cgroup_sockets_enabled && sk->sk_cgrp)
 		return !!sk->sk_cgrp->memory_pressure;
 
-	return !!sk->sk_prot->memory_pressure;
+	return !!*sk->sk_prot->memory_pressure;
 }
 
 static inline void sk_leave_memory_pressure(struct sock *sk)
-- 
1.7.5.4

Re: [PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure

From: David Miller <davem@davemloft.net>
Date: 2013-10-23 20:15:44

From: ebiederm@xmission.com (Eric W. Biederman)
Date: Wed, 23 Oct 2013 12:55:18 -0700
From: Christoph Paasch <redacted>
Date: Wed, 23 Oct 2013 12:49:21 -0700

2e685cad57 (tcp_memcontrol: Kill struct tcp_memcontrol) falsly modified
the access to memory_pressure of sk->sk_prot->memory_pressure. The patch
did modify the memory_pressure-field of struct cg_proto, but not the one
of struct proto.

So, the access to sk_prot->memory_pressure should not be changed.

Acked-by: Eric Dumazet <edumazet@google.com>
Reported-by: Fengguang Wu <redacted>
Signed-off-by: Christoph Paasch <redacted>
Signed-off-by: Eric W. Biederman <redacted>
Applied, but I replaced "Fix: " with "net: " in the commit header line.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help