mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
net: convert sock.sk_wmem_alloc from atomic_t to refcount_t
refcount_t type and corresponding API should be used instead of atomic_t when the variable is used as a reference counter. This allows to avoid accidental refcounter overflows that might lead to use-after-free situations. Signed-off-by: Elena Reshetova <[email protected]> Signed-off-by: Hans Liljestrand <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: David Windsor <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
2638595afc
commit
14afee4b60
37 changed files with 74 additions and 85 deletions
|
|
@ -202,7 +202,7 @@ void rds_tcp_write_space(struct sock *sk)
|
|||
tc->t_last_seen_una = rds_tcp_snd_una(tc);
|
||||
rds_send_path_drop_acked(cp, rds_tcp_snd_una(tc), rds_tcp_is_acked);
|
||||
|
||||
if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf)
|
||||
if ((refcount_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf)
|
||||
queue_delayed_work(rds_wq, &cp->cp_send_w, 0);
|
||||
|
||||
out:
|
||||
|
|
|
|||
Loading…
Reference in a new issue