[lvs-users] [PATCH] libipvs: fix some buffer sizes
horms at verge.net.au
Fri May 25 10:34:19 BST 2018
On Fri, May 25, 2018 at 09:29:35AM +0200, Jesper Dangaard Brouer wrote:
> On Thu, 24 May 2018 23:37:45 +0300 Julian Anastasov <ja at ssi.bg> 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 at ssi.bg>
> This all looks fine to me. I'll give other people a little time to
> review and ACK, before I apply this.
> (To Julian) did you find this by manual review, or did you use some tool
> to find these?
Acked-by: Simon Horman <horms at verge.net.au>
More information about the lvs-users