Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752407AbdLUOSZ (ORCPT ); Thu, 21 Dec 2017 09:18:25 -0500 Received: from mail-ua0-f182.google.com ([209.85.217.182]:46157 "EHLO mail-ua0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752007AbdLUOSP (ORCPT ); Thu, 21 Dec 2017 09:18:15 -0500 X-Google-Smtp-Source: ACJfBouyYwEd/ZFQxZ6x9dyG4YCgwX6tINqeNCvqvvIkMt3bnMb3gIFvlTq+gqc+0vZblOUVMQJszA== Date: Thu, 21 Dec 2017 09:18:11 -0500 From: Tom Horsley To: linux-kernel@vger.kernel.org Subject: ptrace versus setuid changes in 4.14? Message-ID: <20171221091811.5bbb47db@tomh> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 789 Lines: 19 On my fedora 26 box with a 4.13 kernel, when a process under ptrace control did an exec of a setuid program, the program lost all of its setuid privileges and ptrace could operate on it like a normal program. Experimental evidence seems to indicate that on fedora 27 with a 4.14 kernel, ptrace cannot do a PEEKDATA to read anything from the just execed setuid program. (I get errno 5 - I/O error). Am I confused somehow, or did something really change in this vicinity? It puts a real crimp in my fancy debug feature to patch code into a setuid program to make it re-exec itself, then detach from it. (I don't suppose we could get a setoptions feature to tell the kernel to detach from setuid programs automagically and let the debugger know it is no longer in control of the process?)