Received: by 10.223.185.116 with SMTP id b49csp4231563wrg; Tue, 6 Mar 2018 12:03:51 -0800 (PST) X-Google-Smtp-Source: AG47ELtVv6CCeg/h0KQ9jd6mT9JQuspP7cqEe/ijW/kTw+6lbQJ/QKmhjsGp6GTk9JtHHpEm4TY6 X-Received: by 2002:a17:902:968c:: with SMTP id n12-v6mr13291427plp.371.1520366631319; Tue, 06 Mar 2018 12:03:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520366631; cv=none; d=google.com; s=arc-20160816; b=QvM9Hn8Of+zQJ/77aWiCta4VgmiKKgq8X491KxcLI2ucwozVB/50ECa/edUEdlIN0M g2REGL9Vsr7R1uyAWb1xd+To28jMqRu41j98jKXHfl7podn2tYDrasIdcqglHfJ2CN6i Met1GAnXGBcgq8fTl211dfGXZUEu5ov1MX76MX5jXpPb5OqtG+AGCqCWO3WmsqkV7YPL FtoYVJdkguM/bLlKAcs82pqdK9uPbK3tINsjJ6RkaaUncFoI8AgVkfTEtIfi2glnjjzl PG6+tCiqH4gXtCW0n+WSmJz3GwtID2F+x+xEpT/VxYcnaYWz8ceJtRb8inGL4dWj4Rj+ rL+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=NxnBYgXzHo3EhEpg3D+iwGDO+ulhh+EUigkBKoAxetY=; b=KtUZhAEpss78ynTLUJFoBlsfKeLo5k1ebDpNr2iyVeMe+AB87wd6G61qxR+Vu7a6VZ 77iQdmls/CCIudQbY2asPNYlHUI+6pVNyRAc1f4jstCAF4JLOFPqi5qH9d67WIAv4atx udKYbb4uZKZziIzG9t8yROCm1zgF7ovEOTwKfXQ2OGjfXYkIZzjCZXQaqdMAkwJQE2PS Rw+5+j3Hb1hI1Q/xdpgC97ZAScwyKBxnu/8Xv1SgWyY33p6oXV5bnmKbLfGTiOLQbib4 lcr4UKCPvrmVmRNMtguiBWnLZJiJKoW05SrkVlyT/tIts1lbGwvLwMkLEfylLPd9tXUP EApg== 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 u18si10219770pgv.374.2018.03.06.12.03.24; Tue, 06 Mar 2018 12:03:51 -0800 (PST) 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 S1753555AbeCFUBp (ORCPT + 99 others); Tue, 6 Mar 2018 15:01:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:54702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753504AbeCFUBn (ORCPT ); Tue, 6 Mar 2018 15:01:43 -0500 Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 14DF32179F for ; Tue, 6 Mar 2018 20:01:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14DF32179F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org Received: by mail-io0-f175.google.com with SMTP id e7so351254ioj.1 for ; Tue, 06 Mar 2018 12:01:43 -0800 (PST) X-Gm-Message-State: AElRT7Fpu6VbiUrVlHtvsWxoP2rNsiS8hiCicf+jRrtsDLbkyi9rciJ4 UFqAJCY43hD+hPdWGruAKnRV+H2NzjRJmSCJEtbouA== X-Received: by 10.107.40.73 with SMTP id o70mr22476849ioo.6.1520366502380; Tue, 06 Mar 2018 12:01:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.137.101 with HTTP; Tue, 6 Mar 2018 12:01:21 -0800 (PST) In-Reply-To: <20180306013457.1955486-1-ast@kernel.org> References: <20180306013457.1955486-1-ast@kernel.org> From: Andy Lutomirski Date: Tue, 6 Mar 2018 20:01:21 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next] modules: allow modprobe load regular elf binaries To: Alexei Starovoitov , Linus Torvalds Cc: "David S. Miller" , Daniel Borkmann , Greg KH , "Luis R. Rodriguez" , Network Development , LKML , kernel-team@fb.com, Linux API Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 6, 2018 at 1:34 AM, Alexei Starovoitov wrote: > As the first step in development of bpfilter project [1] the request_module() > code is extended to allow user mode helpers to be invoked. Idea is that > user mode helpers are built as part of the kernel build and installed as > traditional kernel modules with .ko file extension into distro specified > location, such that from a distribution point of view, they are no different > than regular kernel modules. Thus, allow request_module() logic to load such > user mode helper (umh) modules via: > > request_module("foo") -> > call_umh("modprobe foo") -> > sys_finit_module(FD of /lib/modules/.../foo.ko) -> > call_umh(struct file) > I assume I'm missing some context here, but why does this need to be handled by the kernel rather than, say, a change to how modprobe works? I imagine that usermode tooling needs to change regardless because the existing tools may get rather confused if a .ko "module" is really a dynamically liked program. I notice that you're using ET_EXEC in your example, and that will probably avoid problems, but I imagine that some distros would much rather use ET_DYN.