Received: by 10.192.165.148 with SMTP id m20csp3840322imm; Mon, 30 Apr 2018 07:17:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZraS87HOW3DLbAWO3hMcA7yj6Uw++7Me9Cs4N3BwoP20HiaBFlOwQSvoWTATmjJweLlV/vo X-Received: by 10.98.156.13 with SMTP id f13mr11139213pfe.15.1525097878202; Mon, 30 Apr 2018 07:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525097878; cv=none; d=google.com; s=arc-20160816; b=ps2ZlFPaqmABddTFTIf/iLK/OR50/JovrfaP0ZsU5WRL/MlyujL1XkYbRG6MOXhNOd vpACG5iRFpVmJhfF2pHP6ziJCQtStXzgdCEW4whKGM7pvjcwpxJZ7IcF/X/Gk4pPXPsP 4Vc3U7j9MSggkM8WoCUJXLBzO69cuJ6xT2JvauDPZOqWpM3zT+C9FOe7ANHfsLA+YoPe feOWUJ1xnkRhYW9+q/NczmMPpkyLCAQKFmiIX7plcCkY0DIHnHDwbABXfdSrKqIdBMwr Y+d+iAQSghCCykFqn7hLvK1N1xDovonubqvjIgKmS4dE2TVyO4NbXj0ql1hbubQQgXCT JomA== 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:dkim-signature :arc-authentication-results; bh=GF4TRdXr6U2AcLxVEEAisZhyiMp/y9KGG2H0jo/Rw5E=; b=sJQIr1p/h5MVXGOv96/AMafjNOIhvLJU1cEyLhvPOvT8OI1Kuvwt2lqHbfxXzgFxuj T3CLK/i9L4YqcuKPsw+ryE+bSsDjiiXI8J07+TiofwbsCoVJS+oG6JAdL5n53RGeNaiK M3j8umrSSE7x6Qd4cZHzdD3LkP6OTvn9JKtbAUvh75yWwBAXYuJi0XahJccIaVo89IsJ GOK4nAV9vq33XN1WJiRUf12WxGy5QyNYuxOX9y5nYNMklq+sQ0kiv0bM0qu7dIYhnTMb riM++Ml34BQs9IJwqh9HGH9vjNiFgNzZa2bugox6h9FbNl23lAyKPDrcoZy/BWCams/s 7oXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=P3dQ/m9g; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23-v6si5468294plo.492.2018.04.30.07.17.44; Mon, 30 Apr 2018 07:17:58 -0700 (PDT) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=P3dQ/m9g; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753921AbeD3OQV (ORCPT + 99 others); Mon, 30 Apr 2018 10:16:21 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:45831 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752868AbeD3OQT (ORCPT ); Mon, 30 Apr 2018 10:16:19 -0400 Received: by mail-oi0-f67.google.com with SMTP id b130-v6so7502147oif.12 for ; Mon, 30 Apr 2018 07:16:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GF4TRdXr6U2AcLxVEEAisZhyiMp/y9KGG2H0jo/Rw5E=; b=P3dQ/m9gBW2FFLY96bExSurQSxLmKBDsokMgQ55/YcpirGy7ED9h9KPn+v66/gzWAs whmrio4LyqzkGWbvG+ycQMsW+UYEY+wvG3qznkSLSUfsZkN3y55aqTKWG3OPYe858JDj /3oxIf1sEpXO86wXMArpPhFNiqI9ScsfJ0DooB1T/KPhZqlHBW0gQe75Tr2lIDJuqnnQ 5AhwPhzggZLM11c09ioHUZAGL2/5aXdjOYZjgyufZeyDn36BJgJEXEYB1lTXryT0guo/ M4swpVKMmxPcXvL+i6FfLdV5DFKRgRGnkbjQgskdzDjl9PMDHpaUWGdUOjaERa1/VEPz dSGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GF4TRdXr6U2AcLxVEEAisZhyiMp/y9KGG2H0jo/Rw5E=; b=jLMymVrZT2++tejG40uucsjs/iGdibOZk5f25RgE5KDkxw94fzBp6ktxbybdNtGjrW rkL1RZzwei57Ckly2sp16n5jWoHRgf8sVlb9XE1/fKgZcEHzX2UudImA63OGvFG9LbMl 6BoAarm5vxKe4dC2tVi09o+KYbpXKD9Qg2gRR7xDWoMF+Dj9ardu8a+RtlFQXKRl9YL/ Synhxai3zzJZPY9XL2iqV0OTFUc/D98xE9witI6rHZWbgqZglNjK0V789bnY6C1C3tjv LUS4D/ujafq89ewoRzFrmxgntrTUQIU3vxnMwq8l1/+RGn3Jd5rgHmkIXQttcn0ze7ZN x5Jw== X-Gm-Message-State: ALQs6tAVm9qxA+epG2gb7S5I6dV6PrW0CrGRBXmGQ6l31vQaH8nqHYw2 vWPB6V5KNQ2swnRUIH+aL9+t5GnsqmjfhF8LJ4/IOA== X-Received: by 2002:aca:1b11:: with SMTP id b17-v6mr7550035oib.173.1525097778916; Mon, 30 Apr 2018 07:16:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.145.144 with HTTP; Mon, 30 Apr 2018 07:15:58 -0700 (PDT) In-Reply-To: <20180427134936.GA31171@kroah.com> References: <20180427123547.15727-1-tmricht@linux.ibm.com> <20180427134936.GA31171@kroah.com> From: Jann Horn Date: Mon, 30 Apr 2018 16:15:58 +0200 Message-ID: Subject: Re: [PATCH v2] inode: debugfs_create_dir uses mode permission from parent To: Greg KH Cc: Kees Cook , Thomas Richter , Kernel Hardening , brueckner@linux.vnet.ibm.com, Martin Schwidefsky , Heiko Carstens , kernel list 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 Fri, Apr 27, 2018 at 3:49 PM, Greg KH wrote: > I'm going to add Kees and the kernel-hardning list here, as I'd like > their opinions for the patch below. > > Kees, do you have any problems with this patch? I know you worked on > making debugfs more "secure" from non-root users, this should still keep > the intial mount permissions all fine, right? Anything I'm not > considering here? > > thanks, > > greg k-h > > On Fri, Apr 27, 2018 at 02:35:47PM +0200, Thomas Richter wrote: >> Currently function debugfs_create_dir() creates a new >> directory in the debugfs (usually mounted /sys/kernel/debug) >> with permission rwxr-xr-x. This is hard coded. >> >> Change this to use the parent directory permission. AFAICS no inodes in debugfs have handlers for the ->rename, ->mkdir, ->create inode ops. What is write permission on debugfs directories useful for?