From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752355AbdKMK5e (ORCPT ); Mon, 13 Nov 2017 05:57:34 -0500 Received: from mga02.intel.com ([134.134.136.20]:29735 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751521AbdKMK5c (ORCPT ); Mon, 13 Nov 2017 05:57:32 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,389,1505804400"; d="asc'?scan'208";a="172909079" From: Felipe Balbi To: John Keeping Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Vincent Pelletier , Jim Lin , Janusz Dziedzic , stable@vger.kernel.org Subject: Re: [PATCH] usb: f_fs: Drop check on Reserved1 field on OS_DESC_EXT_COMPAT In-Reply-To: <20171110183408.4fc19913.john@metanate.com> References: <20171109163429.8697-1-john@metanate.com> <874lq2zaag.fsf@linux.intel.com> <20171110183408.4fc19913.john@metanate.com> Date: Mon, 13 Nov 2017 12:57:21 +0200 Message-ID: <877euue99q.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, John Keeping writes: > On Fri, 10 Nov 2017 12:40:39 +0200, Felipe Balbi wrote: > >> John Keeping writes: >> > This check has gone through several incompatible variations in commits >> > 53642399aa71 ("usb: gadget: f_fs: Fix wrong check on reserved1 of >> > OS_DESC_EXT_COMPAT"), 354bc45bf329 ("usb: gadget: f_fs: Fix ExtCompat >> > descriptor validation") and 3ba534df815f ("Revert "usb: gadget: f_fs: >> > Fix ExtCompat descriptor validation"") after initially being introduced >> > in commit f0175ab51993 ("usb: gadget: f_fs: OS descriptors support"). >> > >> > The various changes make it impossible for a single userspace >> > implementation to work with different kernel versions, so let's just >> > drop the condition to avoid breaking userspace. >> > >> > Fixes: 53642399aa71 ("usb: gadget: f_fs: Fix wrong check on reserved1 = of OS_DESC_EXT_COMPAT") >> > Cc: stable@vger.kernel.org # v4.7+ >> > Signed-off-by: John Keeping >> > --- >> > drivers/usb/gadget/function/f_fs.c | 3 +-- >> > 1 file changed, 1 insertion(+), 2 deletions(-) >> > >> > diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/f= unction/f_fs.c >> > index 652397eda6d6..0d9962834345 100644 >> > --- a/drivers/usb/gadget/function/f_fs.c >> > +++ b/drivers/usb/gadget/function/f_fs.c >> > @@ -2282,8 +2282,7 @@ static int __ffs_data_do_os_desc(enum ffs_os_des= c_type type, >> > int i; >> >=20=20 >> > if (len < sizeof(*d) || >> > - d->bFirstInterfaceNumber >=3D ffs->interfaces_count || >> > - !d->Reserved1) >> > + d->bFirstInterfaceNumber >=3D ffs->interfaces_count) >> > return -EINVAL; >> > for (i =3D 0; i < ARRAY_SIZE(d->Reserved2); ++i) >> > if (d->Reserved2[i])=20=20 >>=20 >> Sorry, but no. We want to be compliant with the specification. If there >> are older still-maintained stable trees which are not working, we need >> to backport a fix to them, but we're not allowing uncompliant >> implementations. > > Aren't we allowing non-compliant implementations now? The spec says the > value must be 1 but since v4.7 this code has allowed all non-zero > values. Good point. Then how about we just force the value to 1 in f_fs.c and remove the check? =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAloJepEACgkQzL64meEa mQYQ4g//cvpjjwBkq3tSZ+eGOyg0/eA2asZWgaUDowWfAApcYTkYLvydrnZtE77S WTTeLK09+HuoI8K2VNSbqfjmQfJJoSxbX+bb875y4WH4fHBVNh5LtOGz5zc0pNdy Kns9WyiOe0Nzy5U7YxqhUPSVZaPtiOWGpJO6MHvd5yh8gUJO4lKo2S6AJlqsJ4KG mQCrMoWBXqrTcvO3UgPwiN+W07F5o1UeuKzlrXtHpzE94Cc0mZXr1IFa4v46xlO7 RXKn92hpgptHvmtw7MZxmu/AlJOLFrBM0kj561/1m3yy1zK9agPjyB+cQBpSluOI a0QtrItgHr9Xq0xJfIKQinKRR9Zeb1YzjwwIMpWKmqu6S7hbLHJ8SuIZBbs6X75Z bMSRHzpYU5td9Y53IbwSgGKhBZujqTwuqYfvW/23SaJE6gosO7IjnY5tHLQe4laE DSPSyd8+smZw1Mw2q5qJplO0vP9nn1vA/z+lvdXT1UYrtdXbNGFYIdzeJ2I9llqy oR3drrgv0TgehJdJmPDj/e/Ykuv70f0w4cu0iNlX2/gVowuR6jgogsswDMlGEtmM JRmgqExNQIa2TAv3wDhTsbYAPH8AgydJHVnZPsKT7KKqAfQYFLmo2gJ4upBlFXj5 DVf//z9MDMqgvKdJYNJKDwc0uq3682HfrOjD3uCEu3NTzbh12hQ= =Uyqo -----END PGP SIGNATURE----- --=-=-=--