LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH] libipvs: fix some buffer sizes

To: Jesper Dangaard Brouer <brouer@xxxxxxxxxx>
Subject: Re: [PATCH] libipvs: fix some buffer sizes
Cc: Simon Horman <horms@xxxxxxxxxxxx>, lvs-devel@xxxxxxxxxxxxxxx, lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Julian Anastasov <ja@xxxxxx>
Date: Fri, 25 May 2018 21:48:31 +0300 (EEST)
        Hello,

On Fri, 25 May 2018, Jesper Dangaard Brouer wrote:

> 
> On Thu, 24 May 2018 23:37:45 +0300 Julian Anastasov <ja@xxxxxx> wrote:
> 
> > Size or length? Here is the answer:
> > 
> > - IP_VS_SCHEDNAME_MAXLEN and IP_VS_IFNAME_MAXLEN are sizes
> > because they are used in kernel structures exported to user
> > space for the old setsockopt interface. We can not change
> > these structures in the kernel.
> > 
> > - IP_VS_PENAME_MAXLEN and IP_VS_PEDATA_MAXLEN are max lengths
> > because they are not exported to the old interface.
> > 
> > As result:
> > - buffers should have space for NUL terminator
> > - strncpy should use sizeof(buffer) - 1 as max length
> > 
> > As we change the libipvs structures, their users should be
> > recompiled.
> > 
> > Signed-off-by: Julian Anastasov <ja@xxxxxx>
> 
> This all looks fine to me.  I'll give other people a little time to
> review and ACK, before I apply this.

        Thanks!

> (To Julian) did you find this by manual review, or did you use some tool
> to find these?

        As you noticed the kernel patch, all started with
the syzkaller report, then by manual review...

Regards

--
Julian Anastasov <ja@xxxxxx>
--
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>