Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932926AbbLGUhf (ORCPT ); Mon, 7 Dec 2015 15:37:35 -0500 Received: from thejh.net ([37.221.195.125]:56199 "EHLO thejh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932716AbbLGUhe (ORCPT ); Mon, 7 Dec 2015 15:37:34 -0500 Date: Mon, 7 Dec 2015 21:38:24 +0100 From: Jann Horn To: Kees Cook Cc: Andrew Morton , Oleg Nesterov , Ingo Molnar , James Morris , "Serge E. Hallyn" , Andy Shevchenko , Andy Lutomirski , Al Viro , "Eric W. Biederman" , Joe Perches , Thomas Gleixner , Michael Kerrisk , LKML , Linux-MM , linux-security-module , Linux API , "security@kernel.org" , Willy Tarreau Subject: Re: [PATCH] ptrace: use fsuid, fsgid, effective creds for fs access checks Message-ID: <20151207203824.GA27364@pc.thejh.net> References: <20151109131902.db961a5fe7b7fcbeb14f72fc@linux-foundation.org> <1449367476-15673-1-git-send-email-jann@thejh.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2219 Lines: 61 --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 07, 2015 at 12:32:06PM -0800, Kees Cook wrote: > On Sat, Dec 5, 2015 at 6:04 PM, Jann Horn wrote: [...] > > - if (ptrace_may_access(task, PTRACE_MODE_READ)) { > > + if (ptrace_may_access(task, PTRACE_MODE_READ | PTRACE_MODE_FSCR= EDS)) { >=20 > This should maybe use the PTRACE_MODE_READ_FSCREDS macro? Oh, yes. I don't know how I missed that. :/ > > error =3D ns_get_path(&ns_path, task, ns_ops); > > if (!error) > > nd_jump_link(&ns_path); > > @@ -63,7 +63,7 @@ static int proc_ns_readlink(struct dentry *dentry, ch= ar __user *buffer, int bufl > > if (!task) > > return res; > > > > - if (ptrace_may_access(task, PTRACE_MODE_READ)) { > > + if (ptrace_may_access(task, PTRACE_MODE_READ | PTRACE_MODE_FSCR= EDS)) { >=20 > same here? Yes. --ZGiS0Q5IWpPtfppv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWZe5AAAoJED4KNFJOeCOocOIQAIPkjimgJ/9cn9hzTXLsNyNA eDdTVMa/MRT4ySXOUlu7FeC+i/FVi+f7SneiX5MPczQDO6t3lbr4LmiT1dpQrzca /uvP+y5bCvzAERBKuBUvKs3dBoonMrMzkGr4oYHjkLiWzzO0oWlQQpiE8It5KdY5 fHeqje5hXihSYKD7YqUavdjJFFU0khkiKr1M5jlO6cUB/OwEJ83G9BpeH2VY31mn 3feLpC1+w1FOozbCYww0LteIXKWyR8cTRPTRrKsvxlj3OaxrAJBQaU0AWkBtZjEr yNHtagE1EBoiPjwcRwAMwWzGUlsUc3lHyq/r5xA8jYHOixM1O6zZ7izYWXlzRx7d NCVg4OVLj1rAkgSlgzFS+dYtVse91+nLA+8vqasXbhtFlDIEA1pTqZ6k+L6y2qL9 Iu60QmrmQjLoZ3OQlQIqaf+rYwCLX835Vw4FlyhEKtAsAcWk2b3Wm0dfEOILlIBz qkK1S8G9nOIPHzFLWEvi8HWmL5qVT6ArnB4yADcNhvTFpahEKpJCxUW4A/m7vYB2 ztwxH68iW2PJHLuBEng6qGyqtZa/IaNmVRd6Kax6mqR7KDoZiubP/FXP8AhDyb/2 6KpC4upUwZ8IByn6q8kkuZm+YjvVIv7Jqu8dhJ9Nfh+o0JWbClCmkwZR0O3SPnxF PUq8xAWIX3hmbpOFcE82 =+R/c -----END PGP SIGNATURE----- --ZGiS0Q5IWpPtfppv-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/