* [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check
@ 2022-01-26 10:08 Neal Liu
2022-01-26 10:51 ` Greg Kroah-Hartman
2022-01-26 16:00 ` Alan Stern
0 siblings, 2 replies; 5+ messages in thread
From: Neal Liu @ 2022-01-26 10:08 UTC (permalink / raw)
To: Felipe Balbi, Greg Kroah-Hartman, Alan Stern, Chen Lin,
Wesley Cheng, Nikita Yushchenko, Cai Huoqing, linux-usb,
linux-kernel, linux-aspeed
Cc: Neal Liu, BMC-SW
READ_TOC cmnd[2] specifies Format Field which is defined
in SCSI-3 spec. Add command mask to avoid marking this
sense data as invalid.
Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
---
drivers/usb/gadget/function/f_mass_storage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
index 46dd11dcb3a8..14d51695b8ae 100644
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -1944,7 +1944,7 @@ static int do_scsi_command(struct fsg_common *common)
common->data_size_from_cmnd =
get_unaligned_be16(&common->cmnd[7]);
reply = check_command(common, 10, DATA_DIR_TO_HOST,
- (7<<6) | (1<<1), 1,
+ (7<<6) | (1<<1) | (1<<2), 1,
"READ TOC");
if (reply == 0)
reply = do_read_toc(common, bh);
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check
2022-01-26 10:08 [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check Neal Liu
@ 2022-01-26 10:51 ` Greg Kroah-Hartman
2022-01-27 2:11 ` Neal Liu
2022-01-26 16:00 ` Alan Stern
1 sibling, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2022-01-26 10:51 UTC (permalink / raw)
To: Neal Liu
Cc: Felipe Balbi, Alan Stern, Chen Lin, Wesley Cheng,
Nikita Yushchenko, Cai Huoqing, linux-usb, linux-kernel,
linux-aspeed, BMC-SW
On Wed, Jan 26, 2022 at 06:08:56PM +0800, Neal Liu wrote:
> READ_TOC cmnd[2] specifies Format Field which is defined
> in SCSI-3 spec. Add command mask to avoid marking this
> sense data as invalid.
>
> Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> ---
> drivers/usb/gadget/function/f_mass_storage.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
> index 46dd11dcb3a8..14d51695b8ae 100644
> --- a/drivers/usb/gadget/function/f_mass_storage.c
> +++ b/drivers/usb/gadget/function/f_mass_storage.c
> @@ -1944,7 +1944,7 @@ static int do_scsi_command(struct fsg_common *common)
> common->data_size_from_cmnd =
> get_unaligned_be16(&common->cmnd[7]);
> reply = check_command(common, 10, DATA_DIR_TO_HOST,
> - (7<<6) | (1<<1), 1,
> + (7<<6) | (1<<1) | (1<<2), 1,
Can we have real names here instead of magic numbers?
And what commit does this fix? Is it a regression or has it always
never worked properly?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check
2022-01-26 10:08 [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check Neal Liu
2022-01-26 10:51 ` Greg Kroah-Hartman
@ 2022-01-26 16:00 ` Alan Stern
2022-01-27 2:11 ` Neal Liu
1 sibling, 1 reply; 5+ messages in thread
From: Alan Stern @ 2022-01-26 16:00 UTC (permalink / raw)
To: Neal Liu
Cc: Felipe Balbi, Greg Kroah-Hartman, Chen Lin, Wesley Cheng,
Nikita Yushchenko, Cai Huoqing, linux-usb, linux-kernel,
linux-aspeed, BMC-SW
On Wed, Jan 26, 2022 at 06:08:56PM +0800, Neal Liu wrote:
> READ_TOC cmnd[2] specifies Format Field which is defined
> in SCSI-3 spec. Add command mask to avoid marking this
> sense data as invalid.
>
> Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> ---
> drivers/usb/gadget/function/f_mass_storage.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
> index 46dd11dcb3a8..14d51695b8ae 100644
> --- a/drivers/usb/gadget/function/f_mass_storage.c
> +++ b/drivers/usb/gadget/function/f_mass_storage.c
> @@ -1944,7 +1944,7 @@ static int do_scsi_command(struct fsg_common *common)
> common->data_size_from_cmnd =
> get_unaligned_be16(&common->cmnd[7]);
> reply = check_command(common, 10, DATA_DIR_TO_HOST,
> - (7<<6) | (1<<1), 1,
> + (7<<6) | (1<<1) | (1<<2), 1,
> "READ TOC");
> if (reply == 0)
> reply = do_read_toc(common, bh);
You've been anticipated:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-testing&id=89ada0fe669a7abf8777b793b874202a0767a24f
Alan Stern
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check
2022-01-26 10:51 ` Greg Kroah-Hartman
@ 2022-01-27 2:11 ` Neal Liu
0 siblings, 0 replies; 5+ messages in thread
From: Neal Liu @ 2022-01-27 2:11 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Felipe Balbi, Alan Stern, Chen Lin, Wesley Cheng,
Nikita Yushchenko, Cai Huoqing, linux-usb, linux-kernel,
linux-aspeed, BMC-SW
> -----Original Message-----
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Sent: Wednesday, January 26, 2022 6:51 PM
> To: Neal Liu <neal_liu@aspeedtech.com>
> Cc: Felipe Balbi <balbi@kernel.org>; Alan Stern <stern@rowland.harvard.edu>;
> Chen Lin <chen.lin5@zte.com.cn>; Wesley Cheng
> <quic_wcheng@quicinc.com>; Nikita Yushchenko
> <nikita.yoush@cogentembedded.com>; Cai Huoqing <caihuoqing@baidu.com>;
> linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-aspeed@lists.ozlabs.org; BMC-SW <BMC-SW@aspeedtech.com>
> Subject: Re: [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask
> check
>
> On Wed, Jan 26, 2022 at 06:08:56PM +0800, Neal Liu wrote:
> > READ_TOC cmnd[2] specifies Format Field which is defined in SCSI-3
> > spec. Add command mask to avoid marking this sense data as invalid.
> >
> > Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> > ---
> > drivers/usb/gadget/function/f_mass_storage.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/gadget/function/f_mass_storage.c
> > b/drivers/usb/gadget/function/f_mass_storage.c
> > index 46dd11dcb3a8..14d51695b8ae 100644
> > --- a/drivers/usb/gadget/function/f_mass_storage.c
> > +++ b/drivers/usb/gadget/function/f_mass_storage.c
> > @@ -1944,7 +1944,7 @@ static int do_scsi_command(struct fsg_common
> *common)
> > common->data_size_from_cmnd =
> > get_unaligned_be16(&common->cmnd[7]);
> > reply = check_command(common, 10, DATA_DIR_TO_HOST,
> > - (7<<6) | (1<<1), 1,
> > + (7<<6) | (1<<1) | (1<<2), 1,
>
> Can we have real names here instead of magic numbers?
>
> And what commit does this fix? Is it a regression or has it always never
> worked properly?
>
> thanks,
>
> greg k-h
This patch fix Windows Server OS installation failure problem.
Since @Roger already sent similar patch fixed, I'll try it.
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-testing&id=89ada0fe669a7abf8777b793b874202a0767a24f
Thanks
-Neal
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check
2022-01-26 16:00 ` Alan Stern
@ 2022-01-27 2:11 ` Neal Liu
0 siblings, 0 replies; 5+ messages in thread
From: Neal Liu @ 2022-01-27 2:11 UTC (permalink / raw)
To: Alan Stern
Cc: Felipe Balbi, Greg Kroah-Hartman, Chen Lin, Wesley Cheng,
Nikita Yushchenko, Cai Huoqing, linux-usb, linux-kernel,
linux-aspeed, BMC-SW
> -----Original Message-----
> From: Alan Stern <stern@rowland.harvard.edu>
> Sent: Thursday, January 27, 2022 12:01 AM
> To: Neal Liu <neal_liu@aspeedtech.com>
> Cc: Felipe Balbi <balbi@kernel.org>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>; Chen Lin <chen.lin5@zte.com.cn>; Wesley
> Cheng <quic_wcheng@quicinc.com>; Nikita Yushchenko
> <nikita.yoush@cogentembedded.com>; Cai Huoqing <caihuoqing@baidu.com>;
> linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-aspeed@lists.ozlabs.org; BMC-SW <BMC-SW@aspeedtech.com>
> Subject: Re: [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask
> check
>
> On Wed, Jan 26, 2022 at 06:08:56PM +0800, Neal Liu wrote:
> > READ_TOC cmnd[2] specifies Format Field which is defined in SCSI-3
> > spec. Add command mask to avoid marking this sense data as invalid.
> >
> > Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> > ---
> > drivers/usb/gadget/function/f_mass_storage.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/gadget/function/f_mass_storage.c
> > b/drivers/usb/gadget/function/f_mass_storage.c
> > index 46dd11dcb3a8..14d51695b8ae 100644
> > --- a/drivers/usb/gadget/function/f_mass_storage.c
> > +++ b/drivers/usb/gadget/function/f_mass_storage.c
> > @@ -1944,7 +1944,7 @@ static int do_scsi_command(struct fsg_common
> *common)
> > common->data_size_from_cmnd =
> > get_unaligned_be16(&common->cmnd[7]);
> > reply = check_command(common, 10, DATA_DIR_TO_HOST,
> > - (7<<6) | (1<<1), 1,
> > + (7<<6) | (1<<1) | (1<<2), 1,
> > "READ TOC");
> > if (reply == 0)
> > reply = do_read_toc(common, bh);
>
> You've been anticipated:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb
> -testing&id=89ada0fe669a7abf8777b793b874202a0767a24f
>
> Alan Stern
Thanks for you info.
-Neal
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-01-27 2:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 10:08 [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check Neal Liu
2022-01-26 10:51 ` Greg Kroah-Hartman
2022-01-27 2:11 ` Neal Liu
2022-01-26 16:00 ` Alan Stern
2022-01-27 2:11 ` Neal Liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.