Re: [PATCH v2] Add refcounts to LED target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jan Engelhardt wrote:
> On Sunday 2010-03-28 03:25, Adam Nielsen wrote:
> 
>> Add reference counting to the LED target so that multiple targets sharing the
>> same trigger don't cause any problems.
> 
> I also noticed one another thing: you don't increase the refcount while 
> xt_led_mutex is held. That means it is theoretically possible that you 
> do a lookup, then a destructor runs and frees the object, leading to 
> ++ledinternal->refcnt dereference an illegal ledinternal.

Indeed, I also noticed this. Basically, you need to make sure that

- the lookup and refcnt increase is atomic,
- the refcnt decrease and list deletion is atomic
- the lookup and list insertion is atomic (in case no trigger exists)

The remaining parts look fine to me, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux