From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f176.google.com ([209.85.223.176]:42830 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbeEKQpp (ORCPT ); Fri, 11 May 2018 12:45:45 -0400 MIME-Version: 1.0 References: <20180511093613.GA1330@comp-core-i7-2640m-0182e6> In-Reply-To: <20180511093613.GA1330@comp-core-i7-2640m-0182e6> From: Linus Torvalds Date: Fri, 11 May 2018 09:45:33 -0700 Message-ID: Subject: Re: [PATCH v5 5/7] proc: instantiate only pids that we can ptrace on 'limit_pids=1' mount option To: gladkov.alexey@gmail.com Cc: Kees Cook , Andrew Lutomirski , Andrew Morton , linux-fsdevel , Linux Kernel Mailing List , Kernel Hardening , LSM List , Linux API , Greg Kroah-Hartman , Al Viro , Akinobu Mita , Oleg Nesterov , Jeff Layton , Ingo Molnar , Alexey Dobriyan , "Eric W. Biederman" , Daniel Micay , Jonathan Corbet , "J. Bruce Fields" , Stephen Rothwell , Solar Designer , "Dmitry V. Levin" , Djalal Harouni Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, May 11, 2018 at 2:46 AM Alexey Gladkov wrote: > + /* Limit procfs to only ptracable tasks */ > + if (limit_pids == PROC_LIMIT_PIDS_PTRACE) { > + cond_resched(); > + if (!has_pid_permissions(fs_info, task, HIDEPID_NO_ACCESS)) > + goto out_put_task; > + } Where did that "cond_resched()" come from? That doesn't seem to make a lot of sense. Linus