Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14633859ybl; Mon, 30 Dec 2019 14:04:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzPXmSvS7CCvAV9ueasAlDoLPWIAzMuSB8oNQL53ECbRYJwF4ev0UZozSgj5Ubb8+Ai/vLB X-Received: by 2002:a9d:62c7:: with SMTP id z7mr68671808otk.189.1577743470511; Mon, 30 Dec 2019 14:04:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577743470; cv=none; d=google.com; s=arc-20160816; b=XuWHGr3PYUhwWYIUli4OH8MYcpBdWxqbPud1GjHOTxeLFhryccvDsikoLhCXO7vBvJ cG9ga7CZVam3O0Ta3zd0BuDVxo00mGeWDf02zeBDNPOF7hEtfDUGdK8u6LAGAHZz8DhU Z1Kn+iieNak11TzzQZ71NFd+ZEg3JXnz3kpyI01GP2QWytuI4p6SH5CsQhR0QYDfNCGe Yiy5EGHRc5N6hmpsfSAtMg6lr4XJfHQjzzd4287AQe/BXSJkwLENIcdF8y+4PT+TeldU vDc82//SSZNjiEQOAzRHGXZ/YyeI+XFx2/wm9BDhzluW1YoWjsOzxN5ueWS1td9al8BQ 5vHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=sWcIwqwAQVaMiL6AbIBVoLXwMM9wjsoCuHsXRphgo8Y=; b=H539lHjDcK+quytxSCp2uAyMjzCfkf2vRR6L//x0tHltsFeOOJL414Kk5EiVXVw8JS 1W1n01SDuVW+ZIcNuGRY8+1DzyPVDvk+82mki0ZdSz4bwyPFpPjkHxCwzPi2ZSzz/2C6 e1l/hdNbuO/3yFwJKKxCVFqELHgAnlKEr35T95KrilMcLdImo9kvGGvTbnG9LSsVUVzF YUyQ5VEYaQOVNCLUruK7lOaqGPF1DtwgKCJ+znQjnaM+I5gVYmEuqYhLeWIMlDjbsSNU UM0oe9EG96nre8CwEs9/p0CCifiCKriftn8+zpR4CHR3uYC0VyY4eUPqJ3/aD13URS+p uIsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nEQfUB9B; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18si11290620oib.170.2019.12.30.14.04.19; Mon, 30 Dec 2019 14:04:30 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=nEQfUB9B; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727775AbfL3WDi (ORCPT + 99 others); Mon, 30 Dec 2019 17:03:38 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38744 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727691AbfL3WDi (ORCPT ); Mon, 30 Dec 2019 17:03:38 -0500 Received: by mail-pl1-f195.google.com with SMTP id f20so15153662plj.5; Mon, 30 Dec 2019 14:03:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=sWcIwqwAQVaMiL6AbIBVoLXwMM9wjsoCuHsXRphgo8Y=; b=nEQfUB9BU7XTfjYvCMI6Yd/qByThVkk2PiHeRSy9HqRXeXx/ACLKilBsXAOBcCROWX wuYYWc18pechAi8K+EkPH15KMlWyQ6nb0StYh3i01u248ouxra+l0YzVMzSbAIdPpj32 8IklPGgLy/ca2jvIWXCX+wjrXBcw+YhdM6dG2drTzpt9BJH4W/VMrXUHA7PFo1I1D0fp bV/2HKq3EUqlQLAmrkiIYXp5l16qLryAJoIvQkBet0s7dkrKl35d2kNDuDe+cTkV6CtO pdBNwQkWVWBXVmtsGPAeYKEJ7QDU9Bg9dcnJKVDvMxCHqk2OAX0edZ0X4oodFaH8Hq0U 10lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=sWcIwqwAQVaMiL6AbIBVoLXwMM9wjsoCuHsXRphgo8Y=; b=hVBUeYUlCs6CqAhqAz823TJP4I7aok2n7HhCS49Q+MIV6qlAPVj1aeV+ulYZh4yk0s 9thbKAY9G/bOcbFwXO045HrVI/GQUWdWsSQGx5IJpowDcnW+9wdcNN+rKbFwZJ6UMUEP cMHMXE9g+qQlG4WCbCzEovuR1dvQsBNesfpeXWV1RnwZ4e0e1gqhPpcL//2xYoDIgVJZ S427ewzNvTEb6irnPBgrnHdQlMnq3IoxpTr3b+WrtwlVONJrhIp6jzxOQSB0IGUwE5Gb mFmqQ6Vhx8V+99kV7PKPHn89ECDfEt7iPt8XmspaARKoIyfLecDhmS5rJKrK+HKSig9o pEQA== X-Gm-Message-State: APjAAAUy/YfQAqm4vm79o9LeA8YY6ValEGXJrOWrVcucn3aCP4B8SyK9 LDtSX2t+F8XF6zVLNJQmYxE= X-Received: by 2002:a17:90a:1696:: with SMTP id o22mr1776310pja.78.1577743416953; Mon, 30 Dec 2019 14:03:36 -0800 (PST) Received: from JF-EN-C02V905BHTDF.tld ([12.111.169.54]) by smtp.gmail.com with ESMTPSA id l8sm511900pjy.24.2019.12.30.14.03.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Dec 2019 14:03:36 -0800 (PST) Subject: Re: [PATCH v6 07/10] proc: flush task dcache entries from all procfs instances To: Alexey Gladkov , LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module Cc: Akinobu Mita , Alexander Viro , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , "Eric W . Biederman" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Kees Cook , Linus Torvalds , Oleg Nesterov , Solar Designer , Stephen Rothwell References: <20191225125151.1950142-1-gladkov.alexey@gmail.com> <20191225125151.1950142-8-gladkov.alexey@gmail.com> From: J Freyensee Message-ID: <8d85ba43-0759-358e-137d-246107bac747@gmail.com> Date: Mon, 30 Dec 2019 14:03:29 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20191225125151.1950142-8-gladkov.alexey@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org snip . . . > > +#ifdef CONFIG_PROC_FS > +static inline void pidns_proc_lock(struct pid_namespace *pid_ns) > +{ > + down_write(&pid_ns->rw_proc_mounts); > +} > + > +static inline void pidns_proc_unlock(struct pid_namespace *pid_ns) > +{ > + up_write(&pid_ns->rw_proc_mounts); > +} > + > +static inline void pidns_proc_lock_shared(struct pid_namespace *pid_ns) > +{ > + down_read(&pid_ns->rw_proc_mounts); > +} > + > +static inline void pidns_proc_unlock_shared(struct pid_namespace *pid_ns) > +{ > + up_read(&pid_ns->rw_proc_mounts); > +} > +#else /* !CONFIG_PROC_FS */ > + Apologies for my newbie question. I couldn't help but notice all these function calls are assuming that the parameter struct pid_namespace *pid_ns will never be NULL.  Is that a good assumption? I don't have the background in this code to answer on my own, but I thought I'd raise the question. Thanks, Jay