netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: apw@canonical.com
Cc: kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org,
	kaber@trash.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, eric.dumazet@gmail.com,
	alexander.duyck@gmail.com
Subject: Re: [PATCH 1/1 V2] ipv4: off-by-one in continuation handling in /proc/net/route
Date: Thu, 13 Aug 2015 21:16:41 -0700 (PDT)	[thread overview]
Message-ID: <20150813.211641.2238542515138447940.davem@davemloft.net> (raw)
In-Reply-To: <1439495341-12095-1-git-send-email-apw@canonical.com>

From: Andy Whitcroft <apw@canonical.com>
Date: Thu, 13 Aug 2015 20:49:01 +0100

> When generating /proc/net/route we emit a header followed by a line for
> each route.  When a short read is performed we will restart this process
> based on the open file descriptor.  When calculating the start point we
> fail to take into account that the 0th entry is the header.  This leads
> us to skip the first entry when doing a continuation read.
> 
> This can be easily seen with the comparison below:
> 
>   while read l; do echo "$l"; done </proc/net/route >A
>   cat /proc/net/route >B
>   diff -bu A B | grep '^[+-]'
> 
> On my example machine I have approximatly 10KB of route output.  There we
> see the very first non-title element is lost in the while read case,
> and an entry around the 8K mark in the cat case:
> 
>   +wlan0 00000000 02021EAC 0003 0 0 400 00000000 0 0 0
>   -tun1  00C0AC0A 00000000 0001 0 0 950 00C0FFFF 0 0 0
> 
> Fix up the off-by-one when reaquiring position on continuation.
> 
> Fixes: 8be33e955cb9 ("fib_trie: Fib walk rcu should take a tnode and key instead of a trie and a leaf")                                   
> BugLink: http://bugs.launchpad.net/bugs/1483440
> Acked-by: Alexander Duyck <alexander.h.duyck@redhat.com>
> Signed-off-by: Andy Whitcroft <apw@canonical.com>

Applied and queued up for -stable, thanks.

      reply	other threads:[~2015-08-14  4:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 19:49 [PATCH 1/1 V2] ipv4: off-by-one in continuation handling in /proc/net/route Andy Whitcroft
2015-08-14  4:16 ` David Miller [this message]

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=20150813.211641.2238542515138447940.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexander.duyck@gmail.com \
    --cc=apw@canonical.com \
    --cc=eric.dumazet@gmail.com \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).