From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C48B5C433DF for ; Wed, 24 Jun 2020 23:15:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8FD3206F7 for ; Wed, 24 Jun 2020 23:15:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388145AbgFXXPZ (ORCPT ); Wed, 24 Jun 2020 19:15:25 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:55849 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728035AbgFXXPZ (ORCPT ); Wed, 24 Jun 2020 19:15:25 -0400 Received: from fsav402.sakura.ne.jp (fsav402.sakura.ne.jp [133.242.250.101]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 05ONEOlM034642; Thu, 25 Jun 2020 08:14:25 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav402.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav402.sakura.ne.jp); Thu, 25 Jun 2020 08:14:24 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav402.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 05ONEOBd034639 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 25 Jun 2020 08:14:24 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [RFC][PATCH] net/bpfilter: Remove this broken and apparently unmantained To: Alexei Starovoitov , "Eric W. Biederman" Cc: Linus Torvalds , Kees Cook , Andrew Morton , Alexei Starovoitov , David Miller , Al Viro , bpf , linux-fsdevel , Daniel Borkmann , Jakub Kicinski , Masahiro Yamada , Gary Lin , Bruno Meneguele , linux-security-module , Casey Schaufler References: <87d066vd4y.fsf@x220.int.ebiederm.org> <20200611233134.5vofl53dj5wpwp5j@ast-mbp.dhcp.thefacebook.com> <87bllngirv.fsf@x220.int.ebiederm.org> <87ftaxd7ky.fsf@x220.int.ebiederm.org> <20200616015552.isi6j5x732okiky4@ast-mbp.dhcp.thefacebook.com> <87h7v1pskt.fsf@x220.int.ebiederm.org> <20200623183520.5e7fmlt3omwa2lof@ast-mbp.dhcp.thefacebook.com> <87h7v1mx4z.fsf@x220.int.ebiederm.org> <20200623194023.lzl34qt2wndhcehk@ast-mbp.dhcp.thefacebook.com> <878sgck6g0.fsf@x220.int.ebiederm.org> From: Tetsuo Handa Message-ID: <2f55102e-5d11-5569-8248-13618d517e93@i-love.sakura.ne.jp> Date: Thu, 25 Jun 2020 08:14:20 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 2020/06/24 23:26, Alexei Starovoitov wrote: > On Wed, Jun 24, 2020 at 5:17 AM Eric W. Biederman wrote: >> >> Alexei Starovoitov writes: >> >>> On Tue, Jun 23, 2020 at 01:53:48PM -0500, Eric W. Biederman wrote: >> >>> There is no refcnt bug. It was a user error on tomoyo side. >>> fork_blob() works as expected. >> >> Nope. I have independently confirmed it myself. > > I guess you've tried Tetsuo's fork_blob("#!/bin/true") kernel module ? > yes. that fails. It never meant to be used for this. > With elf blob it works, but breaks if there are rejections > in things like security_bprm_creds_for_exec(). > In my mind that path was 'must succeed or kernel module is toast'. > Like passing NULL into a function that doesn't check for it. > Working on a fix for that since Tetsuo cares. > What is unhappy for pathname based LSMs is that fork_usermode_blob() creates a file with empty filename. I can imagine that somebody would start abusing fork_usermode_blob() as an interface for starting programs like modprobe, hotplug, udevd and sshd. When such situation happened, how fork_usermode_blob() provides information for identifying the intent of such execve() requests? fork_usermode_blob() might also be an unhappy behavior for inode based LSMs (like SELinux and Smack) because it seems that fork_usermode_blob() can't have a chance to associate appropriate security labels based on the content of the byte array because files are created on-demand. Is fork_usermode_blob() friendly to inode based LSMs?