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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 E17A3C433E0 for ; Fri, 26 Jun 2020 11:35:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1B4120781 for ; Fri, 26 Jun 2020 11:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726378AbgFZLfU (ORCPT ); Fri, 26 Jun 2020 07:35:20 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:56806 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbgFZLfT (ORCPT ); Fri, 26 Jun 2020 07:35:19 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jomdY-0007pG-CV; Fri, 26 Jun 2020 05:35:16 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1jomdX-0000K5-C2; Fri, 26 Jun 2020 05:35:16 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Alexei Starovoitov Cc: Tetsuo Handa , 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 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> Date: Fri, 26 Jun 2020 06:30:48 -0500 In-Reply-To: (Alexei Starovoitov's message of "Wed, 24 Jun 2020 07:26:22 -0700") Message-ID: <87sgeihxnb.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1jomdX-0000K5-C2;;;mid=<87sgeihxnb.fsf@x220.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/z/QlJLLbv8fWfozhts4apX0qJqt5rpEs= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [RFC][PATCH] net/bpfilter: Remove this broken and apparently unmantained X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Alexei Starovoitov writes: > 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. No. The reference counting issue is present with the elf blob. It is very straight forward to see when you take a minute to look. The file is created with shmem_kernel_file_setup in fork_usermode_blob. The file is put in fork_usermode_blob The file is put in free_bprm by exec. Eric