Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752197AbbBRMzS (ORCPT ); Wed, 18 Feb 2015 07:55:18 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:40511 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751315AbbBRMzP (ORCPT ); Wed, 18 Feb 2015 07:55:15 -0500 Message-ID: <1424264106.23608.84.camel@decadent.org.uk> Subject: Re: [PATCH 3.2 090/152] time: adjtimex: Validate the ADJ_FREQUENCY values From: Ben Hutchings To: Luis Henriques Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, akpm@linux-foundation.org, John Stultz , Ingo Molnar , Sasha Levin , Thomas Gleixner Date: Wed, 18 Feb 2015 12:55:06 +0000 In-Reply-To: <20150217141613.GB4915@charon> References: <20150217141613.GB4915@charon> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-ev+hWtXy+kun94SyhdNP" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.4.249 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3421 Lines: 102 --=-ev+hWtXy+kun94SyhdNP Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2015-02-17 at 14:16 +0000, Luis Henriques wrote: > On Tue, Feb 17, 2015 at 01:46:53AM +0000, Ben Hutchings wrote: > > 3.2.67-rc1 review patch. If anyone has any objections, please let me k= now. > > >=20 > John reported a regression with this commit [1]. A fix seems to be > already available, but since it hasn't been accepted into mainline yet > I haven't picked this patch for the 3.16 kernel. >=20 > [1] https://lists.ubuntu.com/archives/kernel-team/2015-February/053981.ht= ml OK, I'll defer this for now. Ben. > Cheers, > -- > Lu=C3=ADs >=20 > > ------------------ > >=20 > > From: Sasha Levin > >=20 > > commit 5e5aeb4367b450a28f447f6d5ab57d8f2ab16a5f upstream. > >=20 > > Verify that the frequency value from userspace is valid and makes sense= . > >=20 > > Unverified values can cause overflows later on. > >=20 > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Signed-off-by: Sasha Levin > > [jstultz: Fix up bug for negative values and drop redunent cap check] > > Signed-off-by: John Stultz > > [bwh: Backported to 3.2: adjust context] > > Signed-off-by: Ben Hutchings > > --- > > kernel/time/ntp.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > >=20 > > --- a/kernel/time/ntp.c > > +++ b/kernel/time/ntp.c > > @@ -608,6 +608,13 @@ int do_adjtimex(struct timex *txc) > > return -EINVAL; > > } > > =20 > > + if (txc->modes & ADJ_FREQUENCY) { > > + if (LONG_MIN / PPM_SCALE > txc->freq) > > + return -EINVAL; > > + if (LONG_MAX / PPM_SCALE < txc->freq) > > + return -EINVAL; > > + } > > + > > if (txc->modes & ADJ_SETOFFSET) { > > struct timespec delta; > > delta.tv_sec =3D txc->time.tv_sec; > >=20 > > -- > > To unsubscribe from this list: send the line "unsubscribe stable" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html --=20 Ben Hutchings To err is human; to really foul things up requires a computer. --=-ev+hWtXy+kun94SyhdNP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIVAwUAVOSLq+e/yOyVhhEJAQqoQA/6A9vp43yeJDeO25qMusrOnINxRWHVH/JR MUX89LQl2Pojdhxcm24MNU4L/p5o4qGzMKQ7IINVNBewrYms+0qjNMGEWdlIkTRA 5IALMUXxPlyO2yq/CH+WTyrBv1eqgPKy8CEbCqsdBs7CC8WYQq5exDuOmZF1Xk4c jJbTSEtXP7HfELud+46I7pflSUmLD6YwcU0vL0jJ/aAcvdCJKw5RWbPUvirWAfUf Pl29pZ9XAQYlNLlJmHr9+zqSSG7h+3Q8RI4oICIzeHzId7ol5t1IMKDgI39LQ7nS 4gzdllezAu6T249CZFn2BtrAuxebLqVKTXQp6xWYmci78/yBRSpTKNYBobEFViU5 Ntuz7hkz2R3N3BLtUJ3Ifelx68Px1q1uBQNM5nv8A3XHjZbOB1NbBz7jEDDrwHpG unhDTz9Dz994TWiK6LIx96AUsxUSouZcs/5YHH88KOEnmtTeSR+g6m/pdSf9XKUT 8mSvb5SXUzagHEdVpE8uziYKN9op6OVGw/X7oMExTDUWXxBpH16/izmNdHXQc0D3 dxnkt1+h5rZuIJSFD4BtUN1EfAD/CK7/h7/+Xl34Bj8TKCViKW24IkNLcWUw5kTw DPud+gT2/heON3Qoxi2vhe8jDJB6YgZwF2Z78vFAeW4Z8rdXZJHI96LrU+lY07Eh DUb3x1fUrTo= =SAV7 -----END PGP SIGNATURE----- --=-ev+hWtXy+kun94SyhdNP-- -- 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/