Re: [PATCH] libipvs: fix some buffer sizes

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

 



On Fri, 25 May 2018 21:48:31 +0300 (EEST)
Julian Anastasov <ja@xxxxxx> wrote:

> 	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!

Applied:
 https://git.kernel.org/pub/scm/utils/kernel/ipvsadm/ipvsadm.git/commit/?id=5cd1778489c52
 
> > (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...

I added a note to the commit desc, pointing to the kernel commit,
gracefully reminding future distro backporters that the kernel side
also have issues in this area ;-)

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer
--
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



[Index of Archives]     [Linux Filesystem Devel]     [Linux NFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [X.Org]

  Powered by Linux