Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:56774 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750924AbbJBCqL (ORCPT ); Thu, 1 Oct 2015 22:46:11 -0400 Message-ID: <1443753950.2730.164.camel@decadent.org.uk> Subject: Re: [PATCHES] Bind mount escape fixes (CVE-2015-2925) From: Ben Hutchings To: "Eric W. Biederman" , stable@vger.kernel.org Cc: Greg Kroah-Hartman , Sasha Levin , Jiri Slaby , Willy Tarreau , Li Zefan Date: Fri, 02 Oct 2015 03:45:50 +0100 In-Reply-To: <87a8s2a7kc.fsf@x220.int.ebiederm.org> References: <87a8s2a7kc.fsf@x220.int.ebiederm.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-l6fi6NqOhmG4N++R/ec/" Mime-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: --=-l6fi6NqOhmG4N++R/ec/ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2015-10-01 at 11:15 -0500, Eric W. Biederman wrote: > With a strategically placed rename bind mounts can be tricked into > giving processes access to the entire filesystem instead of just a piece > of it. This misfeature has existed since bind mounts were introduced > into the kernel. This issue has been fixed in Linus's tree and below > are my tested backports of the fixes to 4.2.1, 4.1.8, 3.18.21, 3.14.53, > 3.12.48, 3.10.89, 3.4.109, 3.2.71, 2.6.32.68. All of the kernels=20 > currently listed as being active. I'm not convinced that this is necessary for the 2.6.32, 3.2 or 3.4 stable branches. While it is possible for an administrator to screw this up, there is no possibility of a user being able to exploit this from a user namespace where they have namespaced-CAP_SYS_ADMIN. > The fixes backported are: > cde93be45a8a90d8c264c776fab63487b5038a65 dcache: Handle escaped paths in = prepend_path > 397d425dc26da728396e66d392d5dcb8dac30c37 vfs: Test for and handle paths t= hat are unreachable from their mnt_root For 3.16 I started with: 70291aecc6aa228c1b3bb36a5f3efdb0af636042 namei: lift (open-coded) terminate= _walk() in follow_dotdot_rcu() into callers which then made the other two trivial to apply. I think that would also work for 3.14 and 3.18. > As I backported the patches the logical work remained the same but the > exact implemenation details changed to fit in with the vfs present in > the older kernels. Minor changes were needed for every the backport to > every kernel except 4.2.1. > > Please queue these changes for the appropriate stable trees. For 4.2, I had the idea that this one was needed too: a03e283bf5c3d4851b4998122196ce9f849e6dfb dcache: Reduce the scope of i_lock= in d_splice_alias but perhaps that is just cleanup/optimisation? Ben. --=20 Ben Hutchings When in doubt, use brute force. - Ken Thompson --=-l6fi6NqOhmG4N++R/ec/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIVAwUAVg3v3+e/yOyVhhEJAQrFKg/8DyZQdXJqLHaPGFiLfzZj6JcY+wMH6SbE fvPhBBv+o2SqQ94AQOwJRJ2dW3swDjv0O3m3Gj4ebN7e+/0EcWyXbTFlmayUizii djwR+UCXs7UjPv6AQSmLAgjr/CaCvQi4hB2LA5nm01g5HGpCk7w2jQkRH86eQS9p WfWYF9ldWl6JNXyS4HvLuNST8k6qnqExId3CyWbOvulrjDRsKD8aXIDDwTk7X4sJ nLrNW1TPpKPipDRnmpuhLTGnL2RuU72ung5AQSfaFAkNsgrbvVvZwv/pWGokHFdN fSF54Rqy8e31zJ4ZLwOIZmRwj/KrUHCYP/49AmwuV710eg2FOpNVb0uk9tTzk3Ws yvNbaZsISE1ZWi1CCPzZoiKZpKhI3TPN0j2QrDM4v5giGBpO6tFYw88pEhWpDwpI WqhyXdNht1xs7yQpYXURybCaXpYuCxRFEve1gXWLhz9c9aQNKHZpJVjXSTEuo0LC GLaqCGaJcVBGZe+dcFxPZBVFIlQgJ7tf2JjLUOwniMSH9yNYFbON8+LxACOSZJ9f bNAeYP18V7oy8fEDXiivOGimSaZAlJy/DXGBZCDacrcNAVCvSPgHjV/3TNj6m719 jiuhdZV9yZH8dFI0rfE8H5eQKMHUsEps2fptglFqzzAldAaSNXEK+GljObw6mmiO SippgJK3i+o= =RSMD -----END PGP SIGNATURE----- --=-l6fi6NqOhmG4N++R/ec/--