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>] [day] [month] [year] [list]
Message-ID: <CALO2TqLB04BGHH9XwXc+TBo1bf3rshCCp61U=FWu76ujNhffMQ@mail.gmail.com>
Date:   Tue, 30 Mar 2021 14:29:41 +0530
From:   Navin P <navinp0304@...il.com>
To:     netdev@...r.kernel.org
Subject: Mismatch between tcp_output.c and tcp_fastopen.c in net/ipv4

Hi,

 I've a question regarding bytes_received and bytes_sent.

 https://elixir.bootlin.com/linux/latest/source/net/ipv4/tcp_output.c#L1385

 In net/ipv4/tcp_output.c
 if (skb->len != tcp_header_size) {
tcp_event_data_sent(tp, sk);
tp->data_segs_out += tcp_skb_pcount(skb);
tp->bytes_sent += skb->len - tcp_header_size;
}


https://elixir.bootlin.com/linux/latest/source/net/ipv4/tcp_fastopen.c#L220

In net/ipv4/tcp_fastopen.c

/* u64_stats_update_begin(&tp->syncp) not needed here,
 * as we certainly are not changing upper 32bit value (0)
 */
tp->bytes_received = skb->len;

Above we miss tcp_header_size.

1. Shouldn't bytes_received be skb->len - tcp_header_size for
consistency ? I'm not sure if skb->len - tcp_header_size is correct .

2. Should it not be skb->len - tcp_header_size - ip_header_size -
skb->mac_len  ?


Regards,
Navin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ