From: William Allen Simpson <william.allen.simpson@gmail.com>
To: Dan Carpenter <error27@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Developers <linux-kernel@vger.kernel.org>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Michael Chan <mchan@broadcom.com>,
Simon Horman <horms@verge.net.au>
Subject: Re: [PATCH v4 2/7] net: remove old tcp_optlen function
Date: Fri, 12 Mar 2010 18:05:41 -0500 [thread overview]
Message-ID: <4B9AC8C5.2010300@gmail.com> (raw)
In-Reply-To: <20100312174656.GA12175@bicker>
All the drama is beside the point. This patch merely removes a *rarely*
used function (2 drivers). Not complicated....
There's a reason that this function isn't used much. It doesn't work.
On 3/12/10 12:46 PM, Dan Carpenter wrote:
> So after you removed the checks this change includes:
I didn't remove any *existing* checks. I had added *new* checks in my
earlier patch, then removed *my* checks from this patch as required by
David Miller.
> 1) Random slagging on the networking guys
I had to look up that "random slagging on" colloquialism. Apparently,
the "random slagging" target would be *me* -- calling me "anal" and my
code "rediculious bloat" [sic] probably qualifies....
(Admittedly, I'm rather careful and may be overly cautious at times, after
some 30+ years of writing network drivers. Once it's in half a billion
cell phones, it's hard/impossible to update.)
Since my first unpleasant interactions with David Miller on my very
earliest (October) netdev posts, I've conspicuously avoided contradicting
him. I've merely *obeyed* his injunction here, and moved on....
The patch itself neutrally documents a coding requirement decision by that
networking maintainer by name.
> 2) u32 => int to ameliorate your static checker's complaints
Good idea. Actually, I simply looked at the code and its history.
> 3) cleanups
>
Removing this function is really a *bug* fix (in several places), with
cleanups in the vicinity for obviously poor coding (variants in 3 places):
- mss = 0;
- if ((mss = skb_shinfo(skb)->gso_size) != 0) {
- int tcp_opt_len, ip_tcp_len;
Cleaner as:
+ mss = skb_shinfo(skb)->gso_size;
+ if (mss != 0) {
+ struct tcphdr *th;
But I wouldn't have bothered had I not been changing that immediately
following line. 30+ years of experience with collaborative projects
informs me that it's best to make minor cleanups only where I'm already
improving the code nearby. Otherwise, it creates patch conflicts.
> People have already explained that tcp_optlen() doesn't return
> negative values.
People? The fact that the calculation itself can be negative appeared
the very first time I tested my own code using this bad function!
> negative values. It would really help us if you could show how
> tcp_hdr(skb)->doff can be less than 5?
>
Oh, I've long since given up on lengthy explanations. Both Eric and
Ilpo have repeatedly castigated me for being too wordy.
In this particular instance, I suggest that you take a look at all the
places that gso_size is set, and cross index with all the code paths that
place these TCP headers onto the txq without a check of doff -- as I did!
I'll specifically mention the tun and virtio_net devices, but I'm also
particularly concerned with af_packet.c and skbuff.c -- and the general
problem with inet_lro.c, too.
Amazingly enough, folks sometimes use Linux for routers....
WARNING: multiple messages have this Message-ID (diff)
From: William Allen Simpson <william.allen.simpson@gmail.com>
To: Dan Carpenter <error27@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Developers <linux-kernel@vger.kernel.org>,
Subject: Re: [PATCH v4 2/7] net: remove old tcp_optlen function
Date: Fri, 12 Mar 2010 18:05:41 -0500 [thread overview]
Message-ID: <4B9AC8C5.2010300@gmail.com> (raw)
In-Reply-To: <20100312174656.GA12175@bicker>
All the drama is beside the point. This patch merely removes a *rarely*
used function (2 drivers). Not complicated....
There's a reason that this function isn't used much. It doesn't work.
On 3/12/10 12:46 PM, Dan Carpenter wrote:
> So after you removed the checks this change includes:
I didn't remove any *existing* checks. I had added *new* checks in my
earlier patch, then removed *my* checks from this patch as required by
David Miller.
> 1) Random slagging on the networking guys
I had to look up that "random slagging on" colloquialism. Apparently,
the "random slagging" target would be *me* -- calling me "anal" and my
code "rediculious bloat" [sic] probably qualifies....
(Admittedly, I'm rather careful and may be overly cautious at times, after
some 30+ years of writing network drivers. Once it's in half a billion
cell phones, it's hard/impossible to update.)
Since my first unpleasant interactions with David Miller on my very
earliest (October) netdev posts, I've conspicuously avoided contradicting
him. I've merely *obeyed* his injunction here, and moved on....
The patch itself neutrally documents a coding requirement decision by that
networking maintainer by name.
> 2) u32 => int to ameliorate your static checker's complaints
Good idea. Actually, I simply looked at the code and its history.
> 3) cleanups
>
Removing this function is really a *bug* fix (in several places), with
cleanups in the vicinity for obviously poor coding (variants in 3 places):
- mss = 0;
- if ((mss = skb_shinfo(skb)->gso_size) != 0) {
- int tcp_opt_len, ip_tcp_len;
Cleaner as:
+ mss = skb_shinfo(skb)->gso_size;
+ if (mss != 0) {
+ struct tcphdr *th;
But I wouldn't have bothered had I not been changing that immediately
following line. 30+ years of experience with collaborative projects
informs me that it's best to make minor cleanups only where I'm already
improving the code nearby. Otherwise, it creates patch conflicts.
> People have already explained that tcp_optlen() doesn't return
> negative values.
People? The fact that the calculation itself can be negative appeared
the very first time I tested my own code using this bad function!
> negative values. It would really help us if you could show how
> tcp_hdr(skb)->doff can be less than 5?
>
Oh, I've long since given up on lengthy explanations. Both Eric and
Ilpo have repeatedly castigated me for being too wordy.
In this particular instance, I suggest that you take a look at all the
places that gso_size is set, and cross index with all the code paths that
place these TCP headers onto the txq without a check of doff -- as I did!
I'll specifically mention the tun and virtio_net devices, but I'm also
particularly concerned with af_packet.c and skbuff.c -- and the general
problem with inet_lro.c, too.
Amazingly enough, folks sometimes use Linux for routers....
next prev parent reply other threads:[~2010-03-12 23:05 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-11 11:35 [PATCH 0/7] tcp: bugs and cleanup for 2.6.34-rc1 William Allen Simpson
2010-03-11 11:41 ` [PATCH v3 1/7] net: tcp_header_len_th and tcp_option_len_th William Allen Simpson
2010-03-11 11:53 ` [PATCH v4 2/7] net: remove old tcp_optlen function William Allen Simpson
2010-03-11 11:54 ` William Allen Simpson
2010-03-12 0:26 ` Simon Horman
2010-03-12 13:21 ` William Allen Simpson
2010-03-12 13:25 ` William Allen Simpson
2010-03-12 17:46 ` Dan Carpenter
2010-03-12 23:05 ` William Allen Simpson [this message]
2010-03-12 23:05 ` William Allen Simpson
2010-03-13 9:11 ` Eric Dumazet
2010-03-13 11:12 ` William Allen Simpson
2010-03-13 11:24 ` Eric Dumazet
2010-03-11 12:08 ` [PATCH v6 3/7] tcp: harmonize tcp_vx_rcv header length assumptions William Allen Simpson
2010-03-11 12:24 ` [PATCH v6 4/7] tcp: input header length, prediction, and timestamp bugs William Allen Simpson
2010-03-11 12:31 ` [PATCH v3 5/7] TCPCT part 2e: accept SYNACK data William Allen Simpson
2010-03-11 12:48 ` [PATCH v6 6/7] TCPCT part 2f: cleanup tcp_parse_options William Allen Simpson
2010-03-11 13:06 ` [PATCH v8 7/7] TCPCT part 2g: parse cookie pair and 64-bit timestamp William Allen Simpson
2010-03-11 15:01 ` [PATCH 0/7] tcp: bugs and cleanup for 2.6.34-rc1 Eric Dumazet
2010-03-11 17:38 ` William Allen Simpson
2010-03-11 18:14 ` Joe Perches
2010-03-12 13:27 ` William Allen Simpson
2010-03-13 5:29 ` Américo Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B9AC8C5.2010300@gmail.com \
--to=william.allen.simpson@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=error27@gmail.com \
--cc=horms@verge.net.au \
--cc=linux-kernel@vger.kernel.org \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.