From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com ([209.85.221.65]:37777 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728565AbeLNPom (ORCPT ); Fri, 14 Dec 2018 10:44:42 -0500 Date: Fri, 14 Dec 2018 18:44:36 +0300 From: Alexey Dobriyan To: =?utf-8?B?56iL5rSL?= Cc: Andrew Morton , David Howells , "Peter Zijlstra (Intel)" , Al Viro , Johannes Weiner , Davidlohr Bueso , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: > [PATCH] Security: Handle hidepid option correctly Message-ID: <20181214154436.GA16772@avx2> References: <18d54cd3edbf4fd3a7c01962f41ead58@cnbox5.mioffice.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Dec 05, 2018 at 03:26:04PM +0800, 程洋 wrote: > Anyone who can review my patch? > > 程洋 于2018年11月30日周五 上午10:34写道: > > > > Here is an article illustrates the details. > > https://medium.com/@topjohnwu/from-anime-game-to-android-system-security-vulnerability-9b955a182f20 > > > > And There is a similar fix on kernel-4.4: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=99663be772c827b8f5f594fe87eb4807be1994e5 > > > > Q: Other filesystems parse the options from fill_super(). Is proc special in some fashion? > > A: According to my research, start_kernel will call proc_mount first, and initialize sb->s_root before any userspace process runs. If others want to mount it, all options will be ignored. > > AOSP change here: https://android-review.googlesource.com/c/platform/system/core/+/181345/4/init/init.cpp > > At first I though we should mount it with MS_REMOUNT flag. But kernel will crash if we did this. This is not true: /proc is mounted by userspace (and it is easy to see from the fact that proc_mount() is not called from kernel anywhere). hidepid= in its current form is misdesigned, so might as well not bother changing anything. IIRC there were(?) patches to make it per-mount.