From owner-freebsd-net@freebsd.org Sun Jan 10 13:32:27 2021 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F0B94CC6D7 for ; Sun, 10 Jan 2021 13:32:27 +0000 (UTC) (envelope-from shamaz.mazum@gmail.com) Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDHnl3C2jz4f52; Sun, 10 Jan 2021 13:32:27 +0000 (UTC) (envelope-from shamaz.mazum@gmail.com) Received: by mail-oi1-x232.google.com with SMTP id 15so17287815oix.8; Sun, 10 Jan 2021 05:32:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eKNe2T3inhmjTnTRQH69fXGTQtYTYo0ljmxCi/IFgUQ=; b=VBDDHhlNDjhITkYHHkv8qEx10QswYMO65rYJ0kUS44jIZK63bCxxjKskROaPfFYWoJ fLIEwZeccyoaTHsDeHLRH/MohiOabRzWZv3tDxkuZxGX0IM0ZmWR+wBXU5wdyqj1W6We /0SPBzDXkXka4t8gmN4f81+B0ld6oR1uJGPIC9ZMIS7cosWlEwYwLw1j+xUEnvqQJGZb AxubgkDZdP1tKauC7huPIVNVBgCCao39kmP91ELhd2yrc9fumDuNcVJJQgaGQEFOatPM WQQWKt2IAWnfhTlCjRU7k2oMF7cm/Z2Z8svZblJJO13Vfp5p824PH8p2qViiOAHNJIqE cz8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eKNe2T3inhmjTnTRQH69fXGTQtYTYo0ljmxCi/IFgUQ=; b=lb8PQl3UWiUcuWtdTYhLC4ok6TDe9+6an/eE+yFCHzwOdzcFDIN5kr/2TEJlq8QR8Q +EG/LeL+TJhVcenhz+4Gi8KwKc0ag/XOwvW5iUDwOiGxMPna2Jp3kqIzANgzJ69gkMTq Qw3TIB/xTMnXk/8emPNJ9hm475C59p/hyILK6s5aJ7ti/QoKHt05HFF1x5bqH2nBitCh pN0+e/hkwWJ87GOiUld2XZtMv6p/Tzc9FB6lpx4EH0IwjsDtxbMF3M95aA2E/BhQnTb4 IgYaf5P9k3eRw6Awl0pdfeJ5lmDMzzWQcyUQh9FeH4VqRYcC+T93mFjqdpX/xIJPq072 6uaQ== X-Gm-Message-State: AOAM530+57cgY5prKYVENdJMHPcc6NOqqlIVbVRbpupsLzYBITnXqQxg dIVGuXPoVXu6IsN+LPv7u2SRG4g5TPjPrqUwcd0W9rNcWLq4/0gF X-Google-Smtp-Source: ABdhPJy/mj61HAP89/rlmXfuwbHVCPyB3Z45JTDE2DnEMVaIx8TurOe1vVum/O6ZXHGgXxsd1jibd2zKhKRCJEw9y/s= X-Received: by 2002:a54:400e:: with SMTP id x14mr7936261oie.21.1610285546115; Sun, 10 Jan 2021 05:32:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Vasily Postnicov Date: Sun, 10 Jan 2021 16:32:13 +0300 Message-ID: Subject: Re: DNS using Name Service Switch module and Casper To: Konstantin Belousov Cc: Mark Johnston , freebsd-net@freebsd.org X-Rspamd-Queue-Id: 4DDHnl3C2jz4f52 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2021 13:32:27 -0000 This is as minimal as I can get. If I knew where to find, what to fix, I would never waste my time seeking for help on mailing lists. Just put FreeBSD in that damn bhyve and play with it, get your hands dirty, you are the developer after all, not me! Your knowledge of FreeBSD is supposedly much greater that mine. For me acceptable solutions are: 1) Remove unsandboxed call to getaddrinfo() from ping. 2) Do not compile with that casper crap which gives false sense of security or whatsoever. I just wanted to help you find a bug where fork() hangs for no reason. So I provided you with all I can get from this situation. Just 20 lines of code to reproduce the bug. And you tell me this is not what you want. So what do you want? A patch that fixes your problem? Sorry for harsh words in your address. But in such situations I question myself should I really report anything and ask anything in FreeBSD community. Btw, if you are still interested, I think I can provide you with the whole bhyve image in which you can reproduce the bug. It contains modified /etc/nsswitch.conf if you cannot change it yourself. =D1=81=D0=B1, 9 =D1=8F=D0=BD=D0=B2. 2021 =D0=B3., 21:47 Konstantin Belousov= : > On Sat, Jan 09, 2021 at 08:25:46PM +0300, Vasily Postnicov wrote: > > Brilliant! It took me almost a day to dive into ZeroMQ to reassure > > myself that there is nothing wrong with it. When I tried to write > > minimal test programs which call fork after pthread_create() in all > > combinations. When I realized that NSS stub module is what I need. > > > > Instructions: > > > > 1) Compile NSS stub module: cc -shared -fPIC -pthread -o > > nss_zerodns.so.1 test.c (Note '.1' at the end). > > 2) Copy nss_zerodns.so.1 to /usr/local/lib > > 3) Apply the patch src_sbin_ping_main.c to ping source code. With this > > patch ping will not quit too early when the initial call to > > getaddrinfo() fails. > > 4) Add stub module to /etc/nsswitch.conf: edit 'hosts' line to be > > 'hosts: files dns zerodns' > > 5) Ping non-existent host, like 'ping foo.bar' > > 6) Ping will hang. The child process which it creates cannot be killed > > even with killall -9 ping > > This is exactly what I do not want. Provide a standalone binary (or > binaries) that can be just run and demonstrate the issue. Without > editing nsswitch.conf or patching ping. >