From: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Infiniband stack allows references to freed memory
Date: Wed, 18 Apr 2012 10:55:48 +0300 [thread overview]
Message-ID: <4F8E7384.9000505@mellanox.com> (raw)
In-Reply-To: <20120418.021558.255251358104374047.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On 4/18/2012 9:15 AM, David Miller wrote:
> I would need to have to go back to the original thread and reread and
> reabsorb the full analysis I did back then to answer this, and I
> really don't have time to do that right now. You're going to have to
> figure out how to fix this race properly on your own or with someone
> else's help.
Sure, I didn't ask you to redo the analysis for the ipoib use case, its
well understood.
I just wanted to see if you can spare few sentences regarding the
neighbour priv mechanism you added in the below sequence, all are your
patches from July 2011 which I think means they were introduced in 3.1.0
Specifically, is there an existing RCU neighbour related framework/call
that a driver which uses neighbour_priv(n) and probably also the
neigh_construct/destroy ndo callbacks, can use to make sure that
modifying the private area isn't racy with readers of that area?
BTW I see that in commit 596b9b68ef118f7409afbc78487263e08ef96261 you
changed IPoIB to set
dev->neigh_priv_len to be sizeof(ipoib_neigh), so you've started a
possible porting here..
Or.
I took a look on the below series and also commit
32092ecf0644e91070f9eff4f6e1edda8f90aecc
"atm: clip: Use device neigh support on top of "arp_tbl" " which made
atm to use the neigh_construct call.
> commit da6a8fa0275e2178c44a875374cae80d057538d1
>
> neigh: Add device constructor/destructor capability.
>
> If the neigh entry has device private state, it will need
> constructor/destructor ops.
>
> commit 869759b9e4160fb8a8d25bc3b4ce3b658523aebb
>
> atm: clip: Convert over to neighbour_priv()
>
>
> commit 76cc714ed5fe6ed90aad5c52ff3030f1f4e22a48
>
> neigh: Do not set tbl->entry_size in ipv4/ipv6 neigh tables.
>
> Let the core self-size the neigh entry based upon the key length.
>
>
> commit 596b9b68ef118f7409afbc78487263e08ef96261
>
> neigh: Add infrastructure for allocating device neigh privates.
>
> netdev->neigh_priv_len records the private area length.
>
> This will trigger for neigh_table objects which set tbl->entry_size
> to zero, and the first instances of this will be forthcoming.
>
>
> commit 5b8b0060cbd6332ae5d1fa0bec0e8e211248d0e7
>
> neigh: Get rid of neigh_table->kmem_cachep
>
> We are going to alloc for device specific private areas for
> neighbour entries, and in order to do that we have to move
> away from the fixed allocation size enforced by using
> neigh_table->kmem_cachep
>
> As a nice side effect we can now use kfree_rcu().
>
> Signed-off-by: David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
>
> commit 1026fec8739663621d64216ba939c23bc1d089b7
>
> neigh: Create mechanism for generic neigh private areas.
>
> The implementation private sits right after the primary_key memory.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-04-18 7:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 20:22 Infiniband stack allows references to freed memory David Miller
[not found] ` <20120201.152213.433850213028883896.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-01 21:04 ` Roland Dreier
[not found] ` <CAG4TOxPrAhac1y-TzA=x47sm88JfQdkrpWW4Em_mBD=KbyRo+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 21:13 ` David Miller
[not found] ` <20120201.161333.2203265702893105548.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-01 21:42 ` Roland Dreier
[not found] ` <CAG4TOxMHG04_REzB9faBcjgUS43845qG5CgDYCUfLDYC6sEjmw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 21:50 ` David Miller
[not found] ` <20120201.165041.1820098802489365638.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-01 22:02 ` David Miller
[not found] ` <20120201.170210.981802234698152048.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-01 22:06 ` Roland Dreier
[not found] ` <CAG4TOxNNTOc0hwjOuEa-p2SBf5GBnEjVQyOERiTq5gkprLioYQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 22:17 ` David Miller
[not found] ` <20120201.171703.1299449838314569881.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-01 23:28 ` Roland Dreier
[not found] ` <CAG4TOxN75jXze4iy_nCBO1vwqvXnwKcqbAFAEFR=n-PdiG4moA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-02 1:21 ` David Miller
[not found] ` <20120201.202128.703330634975191244.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-02 2:19 ` Roland Dreier
2012-04-17 8:02 ` Or Gerlitz
[not found] ` <4F8D23A0.7000109-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-04-18 3:04 ` David Miller
[not found] ` <20120417.230418.1898458010494189728.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-04-18 5:58 ` Or Gerlitz
[not found] ` <4F8E57F8.9050703-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-04-18 6:15 ` David Miller
[not found] ` <20120418.021558.255251358104374047.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-04-18 7:55 ` Or Gerlitz [this message]
2012-02-01 22:26 ` Jason Gunthorpe
[not found] ` <20120201222638.GA24483-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-02-01 23:32 ` Roland Dreier
[not found] ` <CAG4TOxMbDxYYyLRFJqvpDQk99f5cA7M=AA37W9R=yL5tBeshdQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-02 1:02 ` Jason Gunthorpe
[not found] ` <20120202010253.GB25606-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-02-02 1:42 ` Roland Dreier
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=4F8E7384.9000505@mellanox.com \
--to=ogerlitz-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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