From owner-freebsd-current@freebsd.org Thu Nov 16 13:04:49 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8669FDDD182; Thu, 16 Nov 2017 13:04:49 +0000 (UTC) (envelope-from matpockuh@gmail.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B43979F22; Thu, 16 Nov 2017 13:04:49 +0000 (UTC) (envelope-from matpockuh@gmail.com) Received: by mail-it0-x22f.google.com with SMTP id u132so5829832ita.0; Thu, 16 Nov 2017 05:04:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qfK8c6HCp3q3ZjIOTEXyZgXeivxLlQIJF7KsEIVZF7U=; b=oOpn6n/9FJLV15ScR6nLrHt+XWW3W1rG+E8oraWLfL0cBQW8hrV+wkHjLM3uku6WSs O57f8NzHOHmvwEs8LD9asWtcmGjPHejHwNiI5URH8rN4HKXT4ObqlHJkUR10AA0tho+r iHw18JDr2IZEixxX1IvfvYeGWQIZSkxSaBzTaeDNifOYeCoZdOxfxZO/vIKXZeV8+pij hnBUp7lh4Dnqr55d/Ps+znr5gj3HEkYT/7IzzQkfNennN9dTR8nMhWlfGLz0o6X+Yyiq OxtzAgaUVCrq68dETTb0X2KZKSQKCQ53M91GbXFrlbbUHD4v2yuM1nGY+w2cB5S6aG9Q cnmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qfK8c6HCp3q3ZjIOTEXyZgXeivxLlQIJF7KsEIVZF7U=; b=XypLG/p8KLkLLlKN8oA2DYX39/6rAJ9LT6LEU4OvQKiE4VxEECgkKdRvumemGwcCsP 89X/wd9qwjZeSYISFAZkQJLMtC3vAf0RUPbG3vK1HuDOfqbdFeqAidx7SBrheuM8VK1b 1DGE4Q4rQMUq5dtMQ622HdNjV7g/xtHWq1d1OCo5mhO7mTezRgfAlDS2TvsnmhtAWusM eI/O2z3DTK/94kLwtdLRAU3b/1Nt1awB8ycKb+pG1T7/Zk/eSLz4xCKOohbtlr37aUSb X7UZB7EtOeUyrAGYn3kwjmR/CY7/8v8tOQ2pGbp7GyEp2em5ZgNU6ToDAWMtgYbVMcrE 1ARw== X-Gm-Message-State: AJaThX6cuZ2djqDBeCKNYuwt1cWAyzqWsum7oLZdBK2cAn66Xyx5Cb25 8gracV1p4nA+fOnmWFEMpKWCMLXEnlkvKfy/kc5x4A== X-Google-Smtp-Source: AGs4zMbU7Lb1NtLyHJZbOJSJXlfq9Vl+tVU29LQHMknztzUw/FzS88hXf258wjSDVf54ToYCQZdeOsGZCD2FFyInYb4= X-Received: by 10.36.80.14 with SMTP id m14mr2186989itb.148.1510837488120; Thu, 16 Nov 2017 05:04:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.73.26 with HTTP; Thu, 16 Nov 2017 05:04:47 -0800 (PST) In-Reply-To: <20171011192826.xkscmrovch3g7gni@thinker.meka.no-ip.org> References: <20171009072547.jauim6tlfennydf5@hal9000.meka.no-ip.org> <6D37D4AC-9DF4-4D55-8614-43CFC6BDD45E@sigsegv.be> <20171011192826.xkscmrovch3g7gni@thinker.meka.no-ip.org> From: KOT MATPOCKuH Date: Thu, 16 Nov 2017 16:04:47 +0300 Message-ID: Subject: Re: VNET jail and dhclient To: =?UTF-8?B?R29yYW4gTWVracSH?= Cc: Oleg Ginzburg , Kristof Provost , FreeBSD Current , freebsd-jail@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2017 13:04:49 -0000 Hello, all! I'm got same problem... Did someone open an PR for this issue? 2017-10-11 22:48 GMT+03:00 Goran Meki=C4=87 : > On Tue, Oct 10, 2017 at 09:10:37PM +0000, Oleg Ginzburg wrote: > > I think I found something, but I do not understand why this is only > > observed in jail and with commit change this. > > The problem about which the Goran wrote can be fixed with: > > > > # diff -ruN dhclient.c-orig dhclient.c > > --- dhclient.c-orig 2017-10-10 23:51:52.451361000 +0000 > > +++ dhclient.c 2017-10-10 23:54:55.803404000 +0000 > > @@ -479,6 +479,7 @@ > > > > fork_privchld(pipe_fd[0], pipe_fd[1]); > > > > + pidfile_close(pidfile); > > close(ifi->ufdesc); > > ifi->ufdesc =3D -1; > > close(ifi->wfdesc); > > > > > > > > > > From pidfile(3) man page: > > > > The pidfile_close() function closes a pidfile. It should be used > after > > daemon fork()s to start a child process. > > > > > > chroot(2) in dhclient return NOPERM (via global errno). it seems to be > > related to open descriptor outside the chroot. > > > > I'm not sure if this fd leak (due to pidfile_remove at the end of > > dhclient), nevertheless closing pid fd in my jail/FreeBSD12 before > chroot > > solve dhclient issue. > > I can confirm Oleg's patch works for me. Weird one, for sure! > --=20 MATPOCKuH