From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758707AbcHaCiM (ORCPT ); Tue, 30 Aug 2016 22:38:12 -0400 Received: from h2.hallyn.com ([78.46.35.8]:48080 "EHLO h2.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754446AbcHaCiL (ORCPT ); Tue, 30 Aug 2016 22:38:11 -0400 Date: Tue, 30 Aug 2016 21:37:32 -0500 From: "Serge E. Hallyn" To: John Stultz Cc: lkml , Kees Cook , "Serge E. Hallyn" , Andrew Morton , Thomas Gleixner , Arjan van de Ven , Oren Laadan , Ruchi Kandoi , Rom Lemarchand , Todd Kjos , Colin Cross , Nick Kralevich , Dmitry Shmidt , Elliott Hughes , Android Kernel Team Subject: Re: [RESEND][PATCH] proc: Fix timerslack_ns CAP_SYS_NICE check when adjusting self Message-ID: <20160831023731.GA21475@mail.hallyn.com> References: <1471906870-28624-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 29, 2016 at 11:28:47AM -0700, John Stultz wrote: > On Mon, Aug 22, 2016 at 4:01 PM, John Stultz wrote: > > In changing from checking ptrace_may_access(p, PTRACE_MODE_ATTACH_FSCREDS) > > to capable(CAP_SYS_NICE), I missed that ptrace_my_access succeeds > > when p == current, but the CAP_SYS_NICE doesn't. > > > > Thus while the previous commit was intended to loosen the needed > > privledges to modify a processes timerslack, it needlessly restricted > > a task modifying its own timerslack via the proc//timerslack_ns > > (which is permitted also via the PR_SET_TIMERSLACK method). > > > > This patch corrects this by checking if p == current before checking > > the CAP_SYS_NICE value. > > > > This patch applies on top of my two previous patches currently in -mm > > Ping? Any feedback or comments on this one? (sorry - no objection from me on this patch, thanks)