mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00: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 <elena.reshetova@intel.com> Signed-off-by: Hans Liljestrand <ishkamiel@gmail.com> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David Windsor <dwindsor@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2638595afc
commit
14afee4b60
37 changed files with 74 additions and 85 deletions
|
@ -254,7 +254,7 @@ static inline void atm_return(struct atm_vcc *vcc,int truesize)
|
|||
|
||||
static inline int atm_may_send(struct atm_vcc *vcc,unsigned int size)
|
||||
{
|
||||
return (size + atomic_read(&sk_atm(vcc)->sk_wmem_alloc)) <
|
||||
return (size + refcount_read(&sk_atm(vcc)->sk_wmem_alloc)) <
|
||||
sk_atm(vcc)->sk_sndbuf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue