All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [net-next PATCH 0/6] ipv4/fib_trie: Cleanups to prepare for introduction of key vector
Date: Wed, 04 Mar 2015 10:22:44 -0800	[thread overview]
Message-ID: <54F74D74.1050002@redhat.com> (raw)
In-Reply-To: <20150304.125327.2002716390225095168.davem@davemloft.net>


On 03/04/2015 09:53 AM, David Miller wrote:
> From: Alexander Duyck <alexander.h.duyck@redhat.com>
> Date: Wed, 04 Mar 2015 06:51:27 -0800
>
>> If bits can be 32 then idx should be an unsigned long which is 64
>> bits.
> unsigned long is 32-bit on 32-bit platforms

Right, but if unsigned long is 32 bits then usually a pointer is as 
well.  As a result we wouldn't be able to access the upper bits of a 
node with bits == 32 since the size of the tnode would be over 4 * 2^32.

The general idea is the vmalloc should fail when we attempt to allocate 
a bits == 32 tnode on a system w/ only 32b longs.  Then again I think we 
will probably cause a memory corruption on a 32b system since we are 
probably overflowing size_t on the allocation if bits ==32.  I'll have 
to take a look as I believe we are using the offsetof macro and I am not 
sure how that handles a 64b address on a 32b system.

- Alex

      reply	other threads:[~2015-03-04 18:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 21:32 [net-next PATCH 0/6] ipv4/fib_trie: Cleanups to prepare for introduction of key vector Alexander Duyck
2015-03-02 21:32 ` [net-next PATCH 1/6] fib_trie: Only resize tnodes once instead of on each leaf removal in fib_table_flush Alexander Duyck
2015-03-02 21:32 ` [net-next PATCH 2/6] fib_trie: Fib walk rcu should take a tnode and key instead of a trie and a leaf Alexander Duyck
2015-03-02 21:32 ` [net-next PATCH 3/6] fib_trie: Fib find node should return parent Alexander Duyck
2015-03-02 21:32 ` [net-next PATCH 4/6] fib_trie: Update insert and delete to make use of tp from find_node Alexander Duyck
2015-03-02 21:32 ` [net-next PATCH 5/6] fib_trie: move leaf and tnode to occupy the same spot in the key vector Alexander Duyck
2015-03-02 21:32 ` [net-next PATCH 6/6] fib_trie: Make fib_table rcu safe Alexander Duyck
2015-03-04  5:16 ` [net-next PATCH 0/6] ipv4/fib_trie: Cleanups to prepare for introduction of key vector David Miller
2015-03-04 14:51   ` Alexander Duyck
2015-03-04 17:53     ` David Miller
2015-03-04 18:22       ` Alexander Duyck [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=54F74D74.1050002@redhat.com \
    --to=alexander.h.duyck@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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.