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=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 C7F01C433ED for ; Tue, 28 Jul 2020 14:50:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A59BA206D8 for ; Tue, 28 Jul 2020 14:50:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gL5GVj/1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730537AbgG1Ou0 (ORCPT ); Tue, 28 Jul 2020 10:50:26 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:41529 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730523AbgG1OuZ (ORCPT ); Tue, 28 Jul 2020 10:50:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595947824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SWjykGqBMInyrV21RjBwz09v26RfChOpFP7bkHaZWz0=; b=gL5GVj/1Sh/8xRJw5I5V5ugR3rF5SX7ApolewQ5v8l+CqxPmRkEddfBM2fWKmPr5o+xPcN PO6qbLkt9MGtlOYHlicpnJv6zjgDQ5AuueMDgHom+I/0sfySeNluYbmZPiFsddK1nz64LJ V/D+dzbLdGSR7NAT/pKGzovSnc4LnMk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-Zrerl_7zO_amUtxi0bg-EA-1; Tue, 28 Jul 2020 10:50:20 -0400 X-MC-Unique: Zrerl_7zO_amUtxi0bg-EA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 31BB6193F560; Tue, 28 Jul 2020 14:50:18 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.181]) by smtp.corp.redhat.com (Postfix) with SMTP id BE9C069324; Tue, 28 Jul 2020 14:50:15 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 28 Jul 2020 16:50:17 +0200 (CEST) Date: Tue, 28 Jul 2020 16:50:14 +0200 From: Oleg Nesterov To: madvenka@linux.microsoft.com 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 Subject: Re: [PATCH v1 1/4] [RFC] fs/trampfd: Implement the trampoline file descriptor API Message-ID: <20200728145013.GA9972@redhat.com> References: <20200728131050.24443-1-madvenka@linux.microsoft.com> <20200728131050.24443-2-madvenka@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200728131050.24443-2-madvenka@linux.microsoft.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; ? > +EXPORT_SYMBOL_GPL(is_trampfd_vma); why is it exported? Oleg. 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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 559B8C433DF for ; Tue, 28 Jul 2020 14:51:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2505D206D8 for ; Tue, 28 Jul 2020 14:51:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3C2VJCy4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gL5GVj/1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2505D206D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZA3n37ZqqevwozobMdttOfE1f6K49M6E1fuqUw9Uisk=; b=3C2VJCy48Q6J73djdYgfar9GL PmYuitw43iUlzw+hZ2yFHhGP7fymD/bbYkG3r9O+549TJ+LzZhLzaNGGZSaZetnvjcQhGEHMwnT+6 d4ZWY3ZdHksVbr/dYyv9uq6Fd1PxkbQpM73bYqKIUH+pOtuOjlyMgrH6tWwPc+VZ+E5ylzivEbcs0 7rTJ/9LqnsbriGBC78HxDWXhvA91hF6fvSoec66KlYcoi6A0A/xZ4ZCLSVWJ24iVQHqFDiwP6CZtP v3We+sLHXMo9XGXM1rSOmOTKvfVztcDNn2wlde9UYysLn5rnWV6I8fbm3rewjE+vCfErKIwF8sb0m ke+HYOpKw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0Qvz-0003HZ-UQ; Tue, 28 Jul 2020 14:50:27 +0000 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120] helo=us-smtp-1.mimecast.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0Qvx-0003GZ-AF for linux-arm-kernel@lists.infradead.org; Tue, 28 Jul 2020 14:50:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595947824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SWjykGqBMInyrV21RjBwz09v26RfChOpFP7bkHaZWz0=; b=gL5GVj/1Sh/8xRJw5I5V5ugR3rF5SX7ApolewQ5v8l+CqxPmRkEddfBM2fWKmPr5o+xPcN PO6qbLkt9MGtlOYHlicpnJv6zjgDQ5AuueMDgHom+I/0sfySeNluYbmZPiFsddK1nz64LJ V/D+dzbLdGSR7NAT/pKGzovSnc4LnMk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-Zrerl_7zO_amUtxi0bg-EA-1; Tue, 28 Jul 2020 10:50:20 -0400 X-MC-Unique: Zrerl_7zO_amUtxi0bg-EA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 31BB6193F560; Tue, 28 Jul 2020 14:50:18 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.181]) by smtp.corp.redhat.com (Postfix) with SMTP id BE9C069324; Tue, 28 Jul 2020 14:50:15 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 28 Jul 2020 16:50:17 +0200 (CEST) Date: Tue, 28 Jul 2020 16:50:14 +0200 From: Oleg Nesterov To: madvenka@linux.microsoft.com Subject: Re: [PATCH v1 1/4] [RFC] fs/trampfd: Implement the trampoline file descriptor API Message-ID: <20200728145013.GA9972@redhat.com> References: <20200728131050.24443-1-madvenka@linux.microsoft.com> <20200728131050.24443-2-madvenka@linux.microsoft.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200728131050.24443-2-madvenka@linux.microsoft.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200728_105025_415381_F02511E8 X-CRM114-Status: GOOD ( 11.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; ? > +EXPORT_SYMBOL_GPL(is_trampfd_vma); why is it exported? Oleg. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel