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] [day] [month] [year] [list]
Message-ID: <20201105141605.06b936f3@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Thu, 5 Nov 2020 14:16:05 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     menglong8.dong@...il.com
Cc:     kuznet@....inr.ac.ru, yoshfuji@...ux-ipv6.org, davem@...emloft.net,
        ycheng@...gle.com, ncardwell@...gle.com, priyarjha@...gle.com,
        edumazet@...gle.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Menglong Dong <dong.menglong@....com.cn>
Subject: Re: [PATCH net-next] net: udp: introduce UDP_MIB_MEMERRORS for
 udp_mem

On Thu,  5 Nov 2020 02:16:11 -0500 menglong8.dong@...il.com wrote:
> From: Menglong Dong <dong.menglong@....com.cn>
> 
> When udp_memory_allocated is at the limit, __udp_enqueue_schedule_skb
> will return a -ENOBUFS, and skb will be dropped in __udp_queue_rcv_skb
> without any counters being done. It's hard to find out what happened
> once this happen.
> 
> So we introduce a UDP_MIB_MEMERRORS to do this job. Well, this change
> looks friendly to the existing users, such as netstat:
> 
> $ netstat -u -s
> Udp:
>     0 packets received
>     639 packets to unknown port received.
>     158689 packet receive errors
>     180022 packets sent
>     RcvbufErrors: 20930
>     MemErrors: 137759
> UdpLite:
> IpExt:
>     InOctets: 257426235
>     OutOctets: 257460598
>     InNoECTPkts: 181177
> 
> Signed-off-by: Menglong Dong <dong.menglong@....com.cn>

Please CC Paolo since he have you feedback on v1 and Willem de Bruijn
<willemb@...gle.com>.

> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> index 09f0a23d1a01..aa1bd53dd9f9 100644
> --- a/net/ipv4/udp.c
> +++ b/net/ipv4/udp.c
> @@ -2038,6 +2038,9 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
>  		if (rc == -ENOMEM)
>  			UDP_INC_STATS(sock_net(sk), UDP_MIB_RCVBUFERRORS,
>  					is_udplite);
> +		else
> +			UDP_INC_STATS(sock_net(sk), UDP_MIB_MEMERRORS,
> +					is_udplite);

The alignment of the line above is off, just ignore it and align the
new code correctly so that checkpatch does not complain.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ