Re: netdevice refcount question for mirred.c

2005-09-04 Thread jamal
On Sun, 2005-04-09 at 20:20 +0200, Patrick McHardy wrote: > jamal wrote: > > There is no need to check for NULL; if you got that far dev cannot be > > NULL (refer to the first check for parm->ifindex). The device could not > > have disapeared since we are protected by rtnl semaphore. > > It doesn

Re: netdevice refcount question for mirred.c

2005-09-04 Thread Patrick McHardy
jamal wrote: Was this a patch you sent? I also had to stare at it for a minute .. Yes. There is no need to check for NULL; if you got that far dev cannot be NULL (refer to the first check for parm->ifindex). The device could not have disapeared since we are protected by rtnl semaphore. It d

Re: netdevice refcount question for mirred.c

2005-09-02 Thread jamal
On Fri, 2005-02-09 at 02:42 +0200, Patrick McHardy wrote: > Ben Greear wrote: > > > > At about line 132 of mirred.c, there is this code: > > > > if (parm->ifindex) { > > p->ifindex = parm->ifindex; > > if (ret != ACT_P_CREATED) > > > > *** It appears that this check could all

Re: netdevice refcount question for mirred.c

2005-09-01 Thread Patrick McHardy
Ben Greear wrote: > > At about line 132 of mirred.c, there is this code: > > if (parm->ifindex) { > p->ifindex = parm->ifindex; > if (ret != ACT_P_CREATED) > > *** It appears that this check could allow over-writing of p->dev below > without ever calling dev_put on the p-

Re: netdevice refcount question for mirred.c

2005-09-01 Thread David S. Miller
From: Ben Greear <[EMAIL PROTECTED]> Date: Thu, 01 Sep 2005 15:39:31 -0700 > Also, earlier in the method it does a __dev_get_by_index(parm->ifindex), > and continues to use the returned value after that. Couldn't this lead > to a reference-after-free, or does external locking prohibit this? Prob