netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: David Laight <David.Laight@ACULAB.COM>
Cc: pablo@netfilter.org, netfilter-devel@vger.kernel.org,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH 1/5] netfilter: ipset: fix interface comparision in hash-netiface sets
Date: Fri, 29 Jun 2012 20:24:23 +0200	[thread overview]
Message-ID: <20120629182423.GD13074@breakpoint.cc> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B6F6E@saturn3.aculab.com>

David Laight <David.Laight@ACULAB.COM> wrote:
> > From: Florian Westphal <fw@strlen.de>
> > 
> > ifname_compare() assumes that skb->dev is zero-padded,
> > e.g 'eth1\0\0\0\0\0...'. This isn't always the case. e1000 driver does
> > 
> > strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
> > 
> > in e1000_probe(), so once device is registered dev->name memory
> contains
> > 'eth1\0:0:3\0\0\0' (or something like that), which makes eth1 compare
> fail.
> 
> strncpy() would normally zero-fill the destination buffer
> (at least the libc version does).
> 
> So something else must be wrong.

No. driver .probe() runs before the device name is filled in, and no
explict zeroing happens there.

  reply	other threads:[~2012-06-29 18:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-29 15:37 [PATCH 0/5] netfilter fixes for 3.5-rc4 pablo
2012-06-29 15:37 ` [PATCH 1/5] netfilter: ipset: fix interface comparision in hash-netiface sets pablo
2012-06-29 15:41   ` David Laight
2012-06-29 18:24     ` Florian Westphal [this message]
2012-06-29 15:37 ` [PATCH 2/5] netfilter: ipvs: fix dst leak in __ip_vs_addr_is_local_v6 pablo
2012-06-29 15:37 ` [PATCH 3/5] netfilter: update location of my trees pablo
2012-06-29 15:37 ` [PATCH 4/5] netfilter: ipset: fix crash if IPSET_CMD_NONE command is sent pablo
2012-06-29 15:37 ` [PATCH 5/5] netfilter: nfnetlink: fix missing rcu_read_unlock in nfnetlink_rcv_msg pablo
2012-06-29 23:37 ` [PATCH 0/5] netfilter fixes for 3.5-rc4 David Miller

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=20120629182423.GD13074@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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).