LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCHv2 net-next] ipvs: reduce stack usage for sockopt data

To: Julian Anastasov <ja@xxxxxx>
Subject: Re: [PATCHv2 net-next] ipvs: reduce stack usage for sockopt data
Cc: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>, Simon Horman <horms@xxxxxxxxxxxx>, lvs-devel@xxxxxxxxxxxxxxx, Andrey Utkin <andrey.krieger.utkin@xxxxxxxxx>, David Binderman <dcb314@xxxxxxxxxxx>
From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date: Wed, 3 Sep 2014 22:03:00 +0300
On Wed, Sep 03, 2014 at 09:17:38PM +0300, Julian Anastasov wrote:
> > An another question, in do_ip_vs_get_ctl() I can see:
> > 
> > +       copylen = get_arglen[CMDID(cmd)];
> > +       if (*len < (int) copylen || *len < 0) {
> > 
> > len is signed, the casting also enforces signed arithmetics. copylen
> > can be 0 at worst case for unused options. Perhaps I'm overlooking
> > something but I think *len < 0 is redundant.
> 
>       Yes, I added it for readability, it can be
> removed, I checked that it does not generate code when
> I added it. IIRC, Arjan van de Ven mentioned
> about gcc reporting for missing range checks when
> commit 04bcef2a83f40c6db24222b
> ("ipvs: Add boundary check on ioctl arguments") was
> discussed. This is his posting:
> 
> http://marc.info/?l=linux-netdev&m=125443389131548&w=2
> 
>       But I don't know how to check for such warnings
> and if they are still reported.
> 

I think you mean CONFIG_DEBUG_STRICT_USER_COPY_CHECKS.  Unfortunately
it's been turned off on recent versions of GCC since 2fb0815c9ee6
('gcc4: disable __compiletime_object_size for GCC 4.6+')

regards,
dan carpenter


--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>