* Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-24 2:50 ` Jiasheng Jiang
0 siblings, 0 replies; 13+ messages in thread
From: Jiasheng Jiang @ 2022-12-24 2:50 UTC (permalink / raw)
To: gregkh
Cc: neal_liu, joel, andrew, sumit.semwal, christian.koenig,
linux-aspeed, linux-usb, linux-arm-kernel, linux-kernel,
linux-media, dri-devel, linaro-mm-sig, Jiasheng Jiang
Yes, it is the same as mine.
As the previous patch had not been merged into the Linux kernel,
my tool found the same error and report it.
And both of us chose the most concise way to fix the error.
That is why the patches are the same.
Thanks,
Jiang
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-24 2:50 ` Jiasheng Jiang
0 siblings, 0 replies; 13+ messages in thread
From: Jiasheng Jiang @ 2022-12-24 2:50 UTC (permalink / raw)
To: gregkh
Cc: Jiasheng Jiang, linux-aspeed, andrew, neal_liu, linux-usb,
linux-kernel, dri-devel, sumit.semwal, linaro-mm-sig, joel,
christian.koenig, linux-arm-kernel, linux-media
Yes, it is the same as mine.
As the previous patch had not been merged into the Linux kernel,
my tool found the same error and report it.
And both of us chose the most concise way to fix the error.
That is why the patches are the same.
Thanks,
Jiang
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
2022-12-24 2:50 ` Jiasheng Jiang
(?)
@ 2022-12-24 6:37 ` Greg KH
-1 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2022-12-24 6:37 UTC (permalink / raw)
To: Jiasheng Jiang
Cc: neal_liu, joel, andrew, sumit.semwal, christian.koenig,
linux-aspeed, linux-usb, linux-arm-kernel, linux-kernel,
linux-media, dri-devel, linaro-mm-sig
On Sat, Dec 24, 2022 at 10:50:01AM +0800, Jiasheng Jiang wrote:
> Yes, it is the same as mine.
> As the previous patch had not been merged into the Linux kernel,
> my tool found the same error and report it.
> And both of us chose the most concise way to fix the error.
> That is why the patches are the same.
I have no context at all here, what does this refer to?
confused,
greg k-h
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-24 6:37 ` Greg KH
0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2022-12-24 6:37 UTC (permalink / raw)
To: Jiasheng Jiang
Cc: linux-aspeed, andrew, neal_liu, linux-usb, linux-kernel,
dri-devel, sumit.semwal, linaro-mm-sig, joel, christian.koenig,
linux-arm-kernel, linux-media
On Sat, Dec 24, 2022 at 10:50:01AM +0800, Jiasheng Jiang wrote:
> Yes, it is the same as mine.
> As the previous patch had not been merged into the Linux kernel,
> my tool found the same error and report it.
> And both of us chose the most concise way to fix the error.
> That is why the patches are the same.
I have no context at all here, what does this refer to?
confused,
greg k-h
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-24 6:37 ` Greg KH
0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2022-12-24 6:37 UTC (permalink / raw)
To: Jiasheng Jiang
Cc: neal_liu, joel, andrew, sumit.semwal, christian.koenig,
linux-aspeed, linux-usb, linux-arm-kernel, linux-kernel,
linux-media, dri-devel, linaro-mm-sig
On Sat, Dec 24, 2022 at 10:50:01AM +0800, Jiasheng Jiang wrote:
> Yes, it is the same as mine.
> As the previous patch had not been merged into the Linux kernel,
> my tool found the same error and report it.
> And both of us chose the most concise way to fix the error.
> That is why the patches are the same.
I have no context at all here, what does this refer to?
confused,
greg k-h
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-24 7:35 ` Jiasheng Jiang
0 siblings, 0 replies; 13+ messages in thread
From: Jiasheng Jiang @ 2022-12-24 7:35 UTC (permalink / raw)
To: gregkh
Cc: neal_liu, joel, andrew, sumit.semwal, christian.koenig,
linux-aspeed, linux-usb, linux-arm-kernel, linux-kernel,
linux-media, dri-devel, linaro-mm-sig, Jiasheng Jiang
On Fri, Dec 23, 2022 at 10:54:37PM +0800, Greg KH wrote:
>> diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c
>> index 01968e2167f9..7dc2457c7460 100644
>> --- a/drivers/usb/gadget/udc/aspeed_udc.c
>> +++ b/drivers/usb/gadget/udc/aspeed_udc.c
>> @@ -1516,6 +1516,10 @@ static int ast_udc_probe(struct platform_device *pdev)
>> AST_UDC_EP_DMA_SIZE *
>> AST_UDC_NUM_ENDPOINTS,
>> &udc->ep0_buf_dma, GFP_KERNEL);
>> + if (!udc->ep0_buf) {
>> + rc = -ENOMEM;
>> + goto err;
>> + }
>>
>> udc->gadget.speed = USB_SPEED_UNKNOWN;
>> udc->gadget.max_speed = USB_SPEED_HIGH;
>> --
>> 2.25.1
>>
>
> Why is this just a duplicate of the patch previously submitted here:
> https://lore.kernel.org/r/20221125092833.74822-1-yuancan@huawei.com
>
> confused,
>
> greg k-h
Yes, it is the same as mine.
As the previous patch had not been merged into the Linux kernel,
my tool found the same error and report it.
And both of us chose the most concise way to fix the error.
That is why the patches are the same.
Thanks,
Jiang
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-24 7:35 ` Jiasheng Jiang
0 siblings, 0 replies; 13+ messages in thread
From: Jiasheng Jiang @ 2022-12-24 7:35 UTC (permalink / raw)
To: gregkh
Cc: Jiasheng Jiang, linux-aspeed, andrew, neal_liu, linux-usb,
linux-kernel, dri-devel, sumit.semwal, linaro-mm-sig, joel,
christian.koenig, linux-arm-kernel, linux-media
On Fri, Dec 23, 2022 at 10:54:37PM +0800, Greg KH wrote:
>> diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c
>> index 01968e2167f9..7dc2457c7460 100644
>> --- a/drivers/usb/gadget/udc/aspeed_udc.c
>> +++ b/drivers/usb/gadget/udc/aspeed_udc.c
>> @@ -1516,6 +1516,10 @@ static int ast_udc_probe(struct platform_device *pdev)
>> AST_UDC_EP_DMA_SIZE *
>> AST_UDC_NUM_ENDPOINTS,
>> &udc->ep0_buf_dma, GFP_KERNEL);
>> + if (!udc->ep0_buf) {
>> + rc = -ENOMEM;
>> + goto err;
>> + }
>>
>> udc->gadget.speed = USB_SPEED_UNKNOWN;
>> udc->gadget.max_speed = USB_SPEED_HIGH;
>> --
>> 2.25.1
>>
>
> Why is this just a duplicate of the patch previously submitted here:
> https://lore.kernel.org/r/20221125092833.74822-1-yuancan@huawei.com
>
> confused,
>
> greg k-h
Yes, it is the same as mine.
As the previous patch had not been merged into the Linux kernel,
my tool found the same error and report it.
And both of us chose the most concise way to fix the error.
That is why the patches are the same.
Thanks,
Jiang
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
2022-12-15 12:31 ` Jiasheng Jiang
(?)
@ 2022-12-23 14:54 ` Greg KH
-1 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2022-12-23 14:54 UTC (permalink / raw)
To: Jiasheng Jiang
Cc: neal_liu, joel, andrew, sumit.semwal, christian.koenig,
linux-aspeed, linux-usb, linux-arm-kernel, linux-kernel,
linux-media, dri-devel, linaro-mm-sig
On Thu, Dec 15, 2022 at 08:31:12PM +0800, Jiasheng Jiang wrote:
> Add the check for the return value of dma_alloc_coherent in order to
> avoid NULL pointer dereference.
>
> This flaw was found using an experimental static analysis tool we are
> developing, APP-Miner, which has not been disclosed.
>
> The allyesconfig build using GCC 9.3.0 shows no new warning. As we
> don't have a UDC device to test with, no runtime testing was able to
> be performed.
>
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> Changelog:
>
> v2 -> v3:
>
> 1. Add information of finding tool and tests to commit message.
>
> v1 -> v2:
>
> 1. Add "goto err;" when allocation fails.
> ---
> drivers/usb/gadget/udc/aspeed_udc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c
> index 01968e2167f9..7dc2457c7460 100644
> --- a/drivers/usb/gadget/udc/aspeed_udc.c
> +++ b/drivers/usb/gadget/udc/aspeed_udc.c
> @@ -1516,6 +1516,10 @@ static int ast_udc_probe(struct platform_device *pdev)
> AST_UDC_EP_DMA_SIZE *
> AST_UDC_NUM_ENDPOINTS,
> &udc->ep0_buf_dma, GFP_KERNEL);
> + if (!udc->ep0_buf) {
> + rc = -ENOMEM;
> + goto err;
> + }
>
> udc->gadget.speed = USB_SPEED_UNKNOWN;
> udc->gadget.max_speed = USB_SPEED_HIGH;
> --
> 2.25.1
>
Why is this just a duplicate of the patch previously submitted here:
https://lore.kernel.org/r/20221125092833.74822-1-yuancan@huawei.com
confused,
greg k-h
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-23 14:54 ` Greg KH
0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2022-12-23 14:54 UTC (permalink / raw)
To: Jiasheng Jiang
Cc: linux-aspeed, andrew, neal_liu, linux-usb, linux-kernel,
dri-devel, sumit.semwal, linaro-mm-sig, joel, christian.koenig,
linux-arm-kernel, linux-media
On Thu, Dec 15, 2022 at 08:31:12PM +0800, Jiasheng Jiang wrote:
> Add the check for the return value of dma_alloc_coherent in order to
> avoid NULL pointer dereference.
>
> This flaw was found using an experimental static analysis tool we are
> developing, APP-Miner, which has not been disclosed.
>
> The allyesconfig build using GCC 9.3.0 shows no new warning. As we
> don't have a UDC device to test with, no runtime testing was able to
> be performed.
>
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> Changelog:
>
> v2 -> v3:
>
> 1. Add information of finding tool and tests to commit message.
>
> v1 -> v2:
>
> 1. Add "goto err;" when allocation fails.
> ---
> drivers/usb/gadget/udc/aspeed_udc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c
> index 01968e2167f9..7dc2457c7460 100644
> --- a/drivers/usb/gadget/udc/aspeed_udc.c
> +++ b/drivers/usb/gadget/udc/aspeed_udc.c
> @@ -1516,6 +1516,10 @@ static int ast_udc_probe(struct platform_device *pdev)
> AST_UDC_EP_DMA_SIZE *
> AST_UDC_NUM_ENDPOINTS,
> &udc->ep0_buf_dma, GFP_KERNEL);
> + if (!udc->ep0_buf) {
> + rc = -ENOMEM;
> + goto err;
> + }
>
> udc->gadget.speed = USB_SPEED_UNKNOWN;
> udc->gadget.max_speed = USB_SPEED_HIGH;
> --
> 2.25.1
>
Why is this just a duplicate of the patch previously submitted here:
https://lore.kernel.org/r/20221125092833.74822-1-yuancan@huawei.com
confused,
greg k-h
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-23 14:54 ` Greg KH
0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2022-12-23 14:54 UTC (permalink / raw)
To: Jiasheng Jiang
Cc: neal_liu, joel, andrew, sumit.semwal, christian.koenig,
linux-aspeed, linux-usb, linux-arm-kernel, linux-kernel,
linux-media, dri-devel, linaro-mm-sig
On Thu, Dec 15, 2022 at 08:31:12PM +0800, Jiasheng Jiang wrote:
> Add the check for the return value of dma_alloc_coherent in order to
> avoid NULL pointer dereference.
>
> This flaw was found using an experimental static analysis tool we are
> developing, APP-Miner, which has not been disclosed.
>
> The allyesconfig build using GCC 9.3.0 shows no new warning. As we
> don't have a UDC device to test with, no runtime testing was able to
> be performed.
>
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> Changelog:
>
> v2 -> v3:
>
> 1. Add information of finding tool and tests to commit message.
>
> v1 -> v2:
>
> 1. Add "goto err;" when allocation fails.
> ---
> drivers/usb/gadget/udc/aspeed_udc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c
> index 01968e2167f9..7dc2457c7460 100644
> --- a/drivers/usb/gadget/udc/aspeed_udc.c
> +++ b/drivers/usb/gadget/udc/aspeed_udc.c
> @@ -1516,6 +1516,10 @@ static int ast_udc_probe(struct platform_device *pdev)
> AST_UDC_EP_DMA_SIZE *
> AST_UDC_NUM_ENDPOINTS,
> &udc->ep0_buf_dma, GFP_KERNEL);
> + if (!udc->ep0_buf) {
> + rc = -ENOMEM;
> + goto err;
> + }
>
> udc->gadget.speed = USB_SPEED_UNKNOWN;
> udc->gadget.max_speed = USB_SPEED_HIGH;
> --
> 2.25.1
>
Why is this just a duplicate of the patch previously submitted here:
https://lore.kernel.org/r/20221125092833.74822-1-yuancan@huawei.com
confused,
greg k-h
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-15 12:31 ` Jiasheng Jiang
0 siblings, 0 replies; 13+ messages in thread
From: Jiasheng Jiang @ 2022-12-15 12:31 UTC (permalink / raw)
To: gregkh
Cc: neal_liu, joel, andrew, sumit.semwal, christian.koenig,
linux-aspeed, linux-usb, linux-arm-kernel, linux-kernel,
linux-media, dri-devel, linaro-mm-sig, Jiasheng Jiang
Add the check for the return value of dma_alloc_coherent in order to
avoid NULL pointer dereference.
This flaw was found using an experimental static analysis tool we are
developing, APP-Miner, which has not been disclosed.
The allyesconfig build using GCC 9.3.0 shows no new warning. As we
don't have a UDC device to test with, no runtime testing was able to
be performed.
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
Changelog:
v2 -> v3:
1. Add information of finding tool and tests to commit message.
v1 -> v2:
1. Add "goto err;" when allocation fails.
---
drivers/usb/gadget/udc/aspeed_udc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c
index 01968e2167f9..7dc2457c7460 100644
--- a/drivers/usb/gadget/udc/aspeed_udc.c
+++ b/drivers/usb/gadget/udc/aspeed_udc.c
@@ -1516,6 +1516,10 @@ static int ast_udc_probe(struct platform_device *pdev)
AST_UDC_EP_DMA_SIZE *
AST_UDC_NUM_ENDPOINTS,
&udc->ep0_buf_dma, GFP_KERNEL);
+ if (!udc->ep0_buf) {
+ rc = -ENOMEM;
+ goto err;
+ }
udc->gadget.speed = USB_SPEED_UNKNOWN;
udc->gadget.max_speed = USB_SPEED_HIGH;
--
2.25.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-15 12:31 ` Jiasheng Jiang
0 siblings, 0 replies; 13+ messages in thread
From: Jiasheng Jiang @ 2022-12-15 12:31 UTC (permalink / raw)
To: gregkh
Cc: Jiasheng Jiang, linux-aspeed, andrew, neal_liu, linux-usb,
linux-kernel, dri-devel, sumit.semwal, linaro-mm-sig, joel,
christian.koenig, linux-arm-kernel, linux-media
Add the check for the return value of dma_alloc_coherent in order to
avoid NULL pointer dereference.
This flaw was found using an experimental static analysis tool we are
developing, APP-Miner, which has not been disclosed.
The allyesconfig build using GCC 9.3.0 shows no new warning. As we
don't have a UDC device to test with, no runtime testing was able to
be performed.
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
Changelog:
v2 -> v3:
1. Add information of finding tool and tests to commit message.
v1 -> v2:
1. Add "goto err;" when allocation fails.
---
drivers/usb/gadget/udc/aspeed_udc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c
index 01968e2167f9..7dc2457c7460 100644
--- a/drivers/usb/gadget/udc/aspeed_udc.c
+++ b/drivers/usb/gadget/udc/aspeed_udc.c
@@ -1516,6 +1516,10 @@ static int ast_udc_probe(struct platform_device *pdev)
AST_UDC_EP_DMA_SIZE *
AST_UDC_NUM_ENDPOINTS,
&udc->ep0_buf_dma, GFP_KERNEL);
+ if (!udc->ep0_buf) {
+ rc = -ENOMEM;
+ goto err;
+ }
udc->gadget.speed = USB_SPEED_UNKNOWN;
udc->gadget.max_speed = USB_SPEED_HIGH;
--
2.25.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent
@ 2022-12-15 12:31 ` Jiasheng Jiang
0 siblings, 0 replies; 13+ messages in thread
From: Jiasheng Jiang @ 2022-12-15 12:31 UTC (permalink / raw)
To: gregkh
Cc: neal_liu, joel, andrew, sumit.semwal, christian.koenig,
linux-aspeed, linux-usb, linux-arm-kernel, linux-kernel,
linux-media, dri-devel, linaro-mm-sig, Jiasheng Jiang
Add the check for the return value of dma_alloc_coherent in order to
avoid NULL pointer dereference.
This flaw was found using an experimental static analysis tool we are
developing, APP-Miner, which has not been disclosed.
The allyesconfig build using GCC 9.3.0 shows no new warning. As we
don't have a UDC device to test with, no runtime testing was able to
be performed.
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
Changelog:
v2 -> v3:
1. Add information of finding tool and tests to commit message.
v1 -> v2:
1. Add "goto err;" when allocation fails.
---
drivers/usb/gadget/udc/aspeed_udc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c
index 01968e2167f9..7dc2457c7460 100644
--- a/drivers/usb/gadget/udc/aspeed_udc.c
+++ b/drivers/usb/gadget/udc/aspeed_udc.c
@@ -1516,6 +1516,10 @@ static int ast_udc_probe(struct platform_device *pdev)
AST_UDC_EP_DMA_SIZE *
AST_UDC_NUM_ENDPOINTS,
&udc->ep0_buf_dma, GFP_KERNEL);
+ if (!udc->ep0_buf) {
+ rc = -ENOMEM;
+ goto err;
+ }
udc->gadget.speed = USB_SPEED_UNKNOWN;
udc->gadget.max_speed = USB_SPEED_HIGH;
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-12-24 8:22 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-24 2:50 [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent Jiasheng Jiang
2022-12-24 2:50 ` Jiasheng Jiang
2022-12-24 6:37 ` Greg KH
2022-12-24 6:37 ` Greg KH
2022-12-24 6:37 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2022-12-24 7:35 Jiasheng Jiang
2022-12-24 7:35 ` Jiasheng Jiang
2022-12-15 12:31 Jiasheng Jiang
2022-12-15 12:31 ` Jiasheng Jiang
2022-12-15 12:31 ` Jiasheng Jiang
2022-12-23 14:54 ` Greg KH
2022-12-23 14:54 ` Greg KH
2022-12-23 14:54 ` Greg KH
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.