Re: [RFC] x_tables: misuse of try_then_request_module

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

 



On Wed, 09 Mar 2011 14:23:54 +0100
Patrick McHardy <kaber@xxxxxxxxx> wrote:

> Am 09.03.2011 02:23, schrieb Stephen Hemminger:
> > Since xt_find_match() returns ERR_PTR(xx) on error not NULL,
> > the macro try_then_request_module won't work correctly here.
> > The macro expects its first argument will be zero if condition
> > fails. But ERR_PTR(-ENOENT) is not zero.
> > 
> > The correct solution is to propagate the error value
> > back.
> > 
> > Found by inspection, and compile tested only.
> 
> Thanks Stephen. It actually works fine since we don't return
> -ENOENT but 0 if nothing was found. If a non-matching revision
> was found we return -EPROTOTYPE, but that case can only happen
> if the module was already loaded.
> 
> Anyways, this seems quite fragile, so I've applied your patch.

Ok, then change "err = 0" to "err = -ENOENT" at start of xt_find_match
--
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