public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Gao feng <gaofeng@cn•fujitsu.com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: nhorman@tuxdriver•com, davem@davemloft•net,
	linux-kernel@vger•kernel.org, netdev@vger•kernel.org,
	lizefan@huawei•com, tj@kernel•org,
	Eric Dumazet <edumazet@google•com>
Subject: Re: [PATCH] net: cgroup: fix access the unallocated memory in netprio cgroup
Date: Tue, 10 Jul 2012 17:36:50 +0800	[thread overview]
Message-ID: <4FFBF7B2.9070609@cn.fujitsu.com> (raw)
In-Reply-To: <1341911707.3265.4603.camel@edumazet-glaptop>

于 2012年07月10日 17:15, Eric Dumazet 写道:
> On Tue, 2012-07-10 at 16:53 +0800, Gao feng wrote:
>>> Hi Gao
>>>
>>> Is it still needed to call update_netdev_tables() from write_priomap() ?
>>>
>>
>> Yes, I think it's needed,because read_priomap will show all of the net devices,
>>
>> But we may add the netdev after create a netprio cgroup, so the new added netdev's
>> priomap will not be allocated. if we don't call update_netdev_tables in write_priomap,
>> we may access this unallocated memory.
>>
> 
> I realize my question was not clear.
> 
> If we write in write_priomap() a field of a single netdevice,
> why should we allocate memory for all netdevices on the machine ?
> 
> So the question was : Do we really need to call
> update_netdev_tables(alldevs), instead of extend_netdev_table(dev)
> 
> 

I get it.

You are right,Indeed we only need to call extend_netdev_table
for the netdev witch we want to change.

and I read the commit f5c38208d32412d72b97a4f0d44af0eb39feb20b,
found why we need delay allocation.

I will send a v2 patch.

Thanks!

      reply	other threads:[~2012-07-10  9:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09  7:45 [PATCH] net: cgroup: fix out of bounds accesses Eric Dumazet
2012-07-09  8:15 ` Gao feng
2012-07-09 21:51   ` David Miller
2012-07-10  2:33     ` Gao feng
2012-07-10  2:37       ` David Miller
2012-07-09 11:01 ` Neil Horman
2012-07-09 11:50   ` Eric Dumazet
2012-07-09 12:13     ` Neil Horman
2012-07-09 12:40       ` Eric Dumazet
2012-07-09 12:56         ` Neil Horman
2012-07-10  2:31         ` [PATCH] net: cgroup: fix access the unallocated memory in netprio cgroup Gao feng
2012-07-10  4:14           ` Eric Dumazet
2012-07-10  8:53             ` Gao feng
2012-07-10  9:15               ` Eric Dumazet
2012-07-10  9:36                 ` Gao feng [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=4FFBF7B2.9070609@cn.fujitsu.com \
    --to=gaofeng@cn$(echo .)fujitsu.com \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=lizefan@huawei$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nhorman@tuxdriver$(echo .)com \
    --cc=tj@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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