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=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL 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 F30B9C433EC for ; Tue, 28 Jul 2020 14:58:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9E08206D8 for ; Tue, 28 Jul 2020 14:58:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Gy0qVxQM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730554AbgG1O6z (ORCPT ); Tue, 28 Jul 2020 10:58:55 -0400 Received: from linux.microsoft.com ([13.77.154.182]:52920 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730483AbgG1O6y (ORCPT ); Tue, 28 Jul 2020 10:58:54 -0400 Received: from [192.168.254.32] (unknown [47.187.206.220]) by linux.microsoft.com (Postfix) with ESMTPSA id ADCF720B4908; Tue, 28 Jul 2020 07:58:53 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com ADCF720B4908 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1595948334; bh=flkKl1tOpheQSP4WOnmrqgHroHnRne5MuepSoCZsgK0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Gy0qVxQM4lbk87aNiGP/UQJRoHbBkHY8gEBUc9LVHq/JBTxqOXbHBPRz/CbPhTddU WUFnsrL5KmEIrg/s5uke5Hfo8z21XAplUP+QdHA3P0SR/cp8ACNVes2cfOeGq1ux6M Pg8UVJmBdVVeaMAdNOiCJj8wDe04E7A1iipg0+LM= Subject: Re: [PATCH v1 1/4] [RFC] fs/trampfd: Implement the trampoline file descriptor API To: Oleg Nesterov Cc: kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, x86@kernel.org References: <20200728131050.24443-1-madvenka@linux.microsoft.com> <20200728131050.24443-2-madvenka@linux.microsoft.com> <20200728145013.GA9972@redhat.com> From: "Madhavan T. Venkataraman" Message-ID: Date: Tue, 28 Jul 2020 09:58:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200728145013.GA9972@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org Thanks. See inline.. On 7/28/20 9:50 AM, Oleg Nesterov wrote: > On 07/28, madvenka@linux.microsoft.com wrote: >> +bool is_trampfd_vma(struct vm_area_struct *vma) >> +{ >> + struct file *file = vma->vm_file; >> + >> + if (!file) >> + return false; >> + return !strcmp(file->f_path.dentry->d_name.name, trampfd_name); > Hmm, this looks obviously wrong or I am totally confused. A user can > create a file named "[trampfd]", mmap it, and fool trampfd_fault() ? > > Why not > > return file->f_op == trampfd_fops; This is definitely the correct check. I will fix it. > > ? > >> +EXPORT_SYMBOL_GPL(is_trampfd_vma); > why is it exported? This is in common code and is called by arch code. Should I not export it? I guess since the symbol is not used by any modules, I don't need to export it. Please confirm and I will fix this. Madhavan