From owner-cvs-sys Mon Apr 13 16:41:26 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA25324 for cvs-sys-outgoing; Mon, 13 Apr 1998 16:41:26 -0700 (PDT) (envelope-from owner-cvs-sys) Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA25010; Mon, 13 Apr 1998 23:40:12 GMT (envelope-from pb@fasterix.frmug.org) Received: (from uucp@localhost) by frmug.org (8.8.8/frmug-2.2/nospam) with UUCP id BAA09611; Tue, 14 Apr 1998 01:40:04 +0200 (CEST) (envelope-from pb@fasterix.frmug.org) Received: (from pb@localhost) by fasterix.frmug.org (8.8.8/8.8.5/pb-19970302) id BAA12684; Tue, 14 Apr 1998 01:38:25 +0200 (CEST) Message-ID: <19980414013825.TH38245@@> Date: Tue, 14 Apr 1998 01:38:25 +0200 From: pb@fasterix.freenix.org (Pierre Beyssac) To: phk@FreeBSD.ORG (Poul-Henning Kamp) Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-sys@FreeBSD.ORG Subject: Re: cvs commit: src/sys/kern uipc_syscalls.c References: <199804112031.NAA01564@freefall.freebsd.org> X-Mailer: Mutt 0.59.1e Mime-Version: 1.0 In-Reply-To: <199804112031.NAA01564@freefall.freebsd.org>; from Poul-Henning Kamp on Apr 11, 1998 13:31:46 -0700 Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Poul-Henning Kamp writes: > setsockopt() transports user option data in an mbuf. if the user > data is greater than MLEN, setsockopt is unable to pass it onto > the protocol handler. Allocate a cluster in such case. Hum, there is a very similar patch in the INRIA IPv6 patches, except it does an additional m_free(m) before returning. Shouldn't the following patch be added to your code to avoid a mbuf leak ? --- uipc_syscalls.c.orig Mon Apr 13 02:01:29 1998 +++ uipc_syscalls.c Tue Apr 14 01:31:09 1998 @@ -992,10 +992,12 @@ if (m == NULL) return (ENOBUFS); if (uap->valsize > MLEN) { MCLGET(m, M_WAIT); - if(!(m->m_flags & M_EXT)) + if(!(m->m_flags & M_EXT)) { + m_free(m); return (ENOBUFS); + } } error = copyin(uap->val, mtod(m, caddr_t), (u_int)uap->valsize); if (error) { (void) m_free(m); -- Pierre Beyssac pb@fasterix.frmug.org pb@fasterix.freenix.org {Free,Net,Open}BSD, Linux : il y a moins bien, mais c'est plus cher Free domains: http://www.eu.org/ or mail dns-manager@EU.org