From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: Re: [PATCH] libipvs: fix some buffer sizes Date: Tue, 29 May 2018 16:06:55 +0200 Message-ID: <20180529160655.673cd177@redhat.com> References: <20180524203745.25950-1-ja@ssi.bg> <20180525092935.39a68441@redhat.com> Reply-To: "LinuxVirtualServer.org users mailing list." Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lvs-users-bounces@linuxvirtualserver.org Errors-To: lvs-users-bounces+gcll-lvs-users=m.gmane.org@linuxvirtualserver.org To: Julian Anastasov Cc: lvs-devel@vger.kernel.org, lvs-users@linuxvirtualserver.org, Simon Horman , Ryan O'Hara , brouer@redhat.com On Fri, 25 May 2018 21:48:31 +0300 (EEST) Julian Anastasov wrote: > Hello, > > On Fri, 25 May 2018, Jesper Dangaard Brouer wrote: > > > > > On Thu, 24 May 2018 23:37:45 +0300 Julian Anastasov 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 > > > > 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