mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Keeping <john@metanate.com>
To: Felipe Balbi <balbi@kernel.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Vincent Pelletier <plr.vincent@gmail.com>,
	Jim Lin <jilin@nvidia.com>,
	Janusz Dziedzic <januszx.dziedzic@linux.intel.com>,
	John Keeping <john@metanate.com>,
	stable@vger.kernel.org
Subject: [PATCH] usb: f_fs: Drop check on Reserved1 field on OS_DESC_EXT_COMPAT
Date: Thu,  9 Nov 2017 16:34:29 +0000	[thread overview]
Message-ID: <20171109163429.8697-1-john@metanate.com> (raw)

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 <john@metanate.com>
---
 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/function/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_desc_type type,
 		int i;
 
 		if (len < sizeof(*d) ||
-		    d->bFirstInterfaceNumber >= ffs->interfaces_count ||
-		    !d->Reserved1)
+		    d->bFirstInterfaceNumber >= ffs->interfaces_count)
 			return -EINVAL;
 		for (i = 0; i < ARRAY_SIZE(d->Reserved2); ++i)
 			if (d->Reserved2[i])
-- 
2.15.0

             reply	other threads:[~2017-11-09 16:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09 16:34 John Keeping [this message]
2017-11-10 10:40 ` Felipe Balbi
2017-11-10 18:34   ` John Keeping
2017-11-13 10:57     ` Felipe Balbi
2017-11-13 18:19       ` John Keeping
2017-11-27 11:34         ` Felipe Balbi
2017-11-27 18:15           ` [PATCH v2] usb: f_fs: Force Reserved1=1 in OS_DESC_EXT_COMPAT John Keeping

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171109163429.8697-1-john@metanate.com \
    --to=john@metanate.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=januszx.dziedzic@linux.intel.com \
    --cc=jilin@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=plr.vincent@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome