From patchwork Fri May 8 00:58:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Leonardo_M=C3=B6rlein?= X-Patchwork-Id: 1285700 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=irrelefant.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=ViqhBAs0; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49JBmD5GFBz9sPF for ; Fri, 8 May 2020 10:58:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WEwiI7zFmidYHRFoPnxFJaRYIltg/3cweIq3BSrKVLA=; b=ViqhBAs0N1SRR/ KFSetdaDWZPG0DlMWpd7BGVuZKnCvWwtP+cFpfNUdcBz3DECPYAg633gDTA38cDMxaWEmBUlBsBjY kou8GHyEUMFSrkUJ+xAR92t6qMhW7H4MiD/+Xmx3c6g9QGygfuhLCPiUPMT3Sz6Du6mOhawxXfnOE 4Ttc36d99Z7HZFEzdHv+y4hBR7GSD3S9njyCwVZfo3J4U0XqeWmw6na9PUoGyifDoEfDNCxCqmvGn rpS/+RFk7kms2/M/S+ahiJ3XIPSEt8aQPCr3nXXrK/MFtQ231lbaa1ExXj8tAdXsC8iXzLcDj4Rw/ d+T2ypx/n0+/0iEgXN8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWrLk-0003AZ-6x; Fri, 08 May 2020 00:58:48 +0000 Received: from smtprelay08.ispgateway.de ([134.119.228.98]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWrLg-00039R-2T for openwrt-devel@lists.openwrt.org; Fri, 08 May 2020 00:58:45 +0000 Received: from [82.207.205.5] (helo=orange.fritz.box) by smtprelay08.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1jWrLS-0006lJ-RK; Fri, 08 May 2020 02:58:30 +0200 From: =?utf-8?q?Leonardo_M=C3=B6rlein?= To: openwrt-devel@lists.openwrt.org Date: Fri, 8 May 2020 02:58:25 +0200 Message-Id: <20200508005825.749631-2-me@irrelefant.net> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200508005825.749631-1-me@irrelefant.net> References: <20200508005825.749631-1-me@irrelefant.net> MIME-Version: 1.0 X-Df-Sender: bWVAaXJyZWxlZmFudC5uZXQ= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200507_175844_113719_D87BE911 X-CRM114-Status: UNSURE ( 6.66 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [134.119.228.98 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [134.119.228.98 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 SPF_NONE SPF: sender does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH procd 2/2] jail: unnamed jails can not have netns (fix segfault) X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Leonardo_M=C3=B6rlein?= , daniel@makrotopia.org Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Leonardo Mörlein --- jail/jail.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jail/jail.c b/jail/jail.c index 67d4cad..a52c264 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -841,6 +841,10 @@ int main(int argc, char **argv) } if (opts.namespace & CLONE_NEWNET) { + if (!opts.name) { + ERROR("netns needs a named jail\n"); + return -1; + } netns_fd = netns_open_pid(jail_process.pid); netns_updown(jail_process.pid, true); }