Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1113336imm; Wed, 23 May 2018 10:28:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrcjuRvWLYGfm9czbIsmzh5Rb5BtD8UEq9om8L3JyhyiynnROZ6Z4xzBNFqoHTdAjL8JZuF X-Received: by 2002:a63:6d0c:: with SMTP id i12-v6mr3102433pgc.314.1527096505128; Wed, 23 May 2018 10:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527096505; cv=none; d=google.com; s=arc-20160816; b=WfeYLN6Hzf3o8h9Zf8MBTGlaJKvlF1/NXXjoK+jzyl7eTOeSte/fe3kUWf58+YulMI aHFVEDd+kkQTxQvd6QZSK/Vm4iKw4tM4XhNl0III0zj66xjVJSUaljAEQFf6cVSkSq7j R0v1iNW+HiENGElbRyYdHKbaq4nK3F515PJjnbbh8Kvl5sR7b8jn44FPvxczkKwW4Hz3 GD9+jLSswuLvaseX0/JFkuDlrKVQxShwp7s2y84N40oOaFyYpsqa/Z8L3ivIdNOBLav2 D13KRePBWIaqkCXg+YBZCyEXCuYokAGIaB/B08M0KlpKhWtZI76p/WSsC8qWpimfHopB yu3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=DMx8LAU71KOZoUlhs+/HdMYXDiheez+uiaKT6JSTheE=; b=wCq4qhk2nBNvFwuobBKadV/udQvHkSUmmLr2AucElc493cMFdCu5hU0J1O7avkWPI9 q3kfY/1luPlIFSLGu6TawoYrkyS9HPfYmqBQTihbzSdmeZJ9vnirT7RBiuvdir0Y9sHh pzDldCHAo3R3ZwtBgvpVnun5Dc7tk/4w9kdolnTBk4bk+AA0Lkp2F/hSWSVBoSf2cA9K qNBvVrZU9OjtYoyMFwxUwiPs5qy9KZ/P+8Aht8AzmsV4J798bmSPWExAEsSGuZe/b2oh UirXc7La9hwJ0y0pFwTvyLFELGK8FhjsLChSjzz2loryzBM/9w0n4Hem9dLAcwhXAKRi y6JQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s128-v6si3061584pgc.464.2018.05.23.10.28.09; Wed, 23 May 2018 10:28:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933827AbeEWR0x (ORCPT + 99 others); Wed, 23 May 2018 13:26:53 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:60198 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933760AbeEWR0u (ORCPT ); Wed, 23 May 2018 13:26:50 -0400 Received: from localhost (pool-173-77-163-54.nycmny.fios.verizon.net [173.77.163.54]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 2BFCB144CDCB4; Wed, 23 May 2018 10:26:49 -0700 (PDT) Date: Wed, 23 May 2018 13:26:48 -0400 (EDT) Message-Id: <20180523.132648.459690706167609338.davem@davemloft.net> To: ast@kernel.org Cc: daniel@iogearbox.net, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, luto@amacapital.net, mcgrof@kernel.org, keescook@chromium.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH v3 net-next 0/2] bpfilter From: David Miller In-Reply-To: <20180522022230.2492505-1-ast@kernel.org> References: <20180522022230.2492505-1-ast@kernel.org> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 23 May 2018 10:26:49 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexei Starovoitov Date: Mon, 21 May 2018 19:22:28 -0700 > v2->v3: > - followed Luis's suggestion and significantly simplied first patch > with shmem_kernel_file_setup+kernel_write. Added kdoc for new helper > - fixed typos and race to access pipes with mutex > - tested with bpfilter being 'builtin'. CONFIG_BPFILTER_UMH=y|m both work. > Interesting to see a usermode executable being embedded inside vmlinux. > - it doesn't hurt to enable bpfilter in .config. > ip_setsockopt commands sent to usermode via pipes and -ENOPROTOOPT is > returned from userspace, so kernel falls back to original iptables code > > v1->v2: > this patch set is almost a full rewrite of the earlier umh modules approach > The v1 of patches and follow up discussion was covered by LWN: > https://lwn.net/Articles/749108/ > > I believe the v2 addresses all issues brought up by Andy and others. > Mainly there are zero changes to kernel/module.c > Instead of teaching module loading logic to recognize special > umh module, let normal kernel modules execute part of its own > .init.rodata as a new user space process (Andy's idea) > Patch 1 introduces this new helper: > int fork_usermode_blob(void *data, size_t len, struct umh_info *info); > Input: > data + len == executable file > Output: > struct umh_info { > struct file *pipe_to_umh; > struct file *pipe_from_umh; > pid_t pid; > }; Series applied, let the madness begin... :-)