lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 25 Jan 2018 12:03:02 -0500 (EST)
From:   David Miller <davem@...emloft.net>
To:     guro@...com
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-team@...com, edumazet@...gle.com, hannes@...xchg.org,
        tj@...nel.org
Subject: Re: [PATCH net] net: memcontrol: charge allocated memory after
 mem_cgroup_sk_alloc()

From: Roman Gushchin <guro@...com>
Date: Thu, 25 Jan 2018 00:19:11 +0000

> @@ -476,6 +477,10 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err, bool kern)
>  		spin_unlock_bh(&queue->fastopenq.lock);
>  	}
>  	mem_cgroup_sk_alloc(newsk);
> +	amt = sk_memory_allocated(newsk);
> +	if (amt && newsk->sk_memcg)
> +		mem_cgroup_charge_skmem(newsk->sk_memcg, amt);
> +

This looks confusing to me.

sk_memory_allocated() is the total amount of memory used by all
sockets for a particular "struct proto", not just for that specific
socket.

Maybe I don't understand how this socket memcg stuff works, but it
seems like you should be looking instead at how much memory is
allocated to this specific socket.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ