* [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment
@ 2020-11-25 13:55 ` Colin King
0 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2020-11-25 13:55 UTC (permalink / raw)
To: Barry Song, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The assignment of argp is currently using argp as the source because of
a typo. Fix this by assigning it the value passed in arg instead.
Addresses-Coverity: ("Uninitialized pointer read")
Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming DMA APIs")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
kernel/dma/map_benchmark.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
index ca616b664f72..e1e37603d01b 100644
--- a/kernel/dma/map_benchmark.c
+++ b/kernel/dma/map_benchmark.c
@@ -192,7 +192,7 @@ static long map_benchmark_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
struct map_benchmark_data *map = file->private_data;
- void __user *argp = (void __user *)argp;
+ void __user *argp = (void __user *)arg;
u64 old_dma_mask;
int ret;
--
2.29.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment
@ 2020-11-25 13:55 ` Colin King
0 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2020-11-25 13:55 UTC (permalink / raw)
To: Barry Song, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The assignment of argp is currently using argp as the source because of
a typo. Fix this by assigning it the value passed in arg instead.
Addresses-Coverity: ("Uninitialized pointer read")
Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming DMA APIs")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
kernel/dma/map_benchmark.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
index ca616b664f72..e1e37603d01b 100644
--- a/kernel/dma/map_benchmark.c
+++ b/kernel/dma/map_benchmark.c
@@ -192,7 +192,7 @@ static long map_benchmark_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
struct map_benchmark_data *map = file->private_data;
- void __user *argp = (void __user *)argp;
+ void __user *argp = (void __user *)arg;
u64 old_dma_mask;
int ret;
--
2.29.2
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 8+ messages in thread* RE: [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment
2020-11-25 13:55 ` Colin King
(?)
@ 2020-11-25 18:22 ` Song Bao Hua (Barry Song)
-1 siblings, 0 replies; 8+ messages in thread
From: Song Bao Hua (Barry Song) @ 2020-11-25 18:22 UTC (permalink / raw)
To: Colin King, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu@lists.linux-foundation.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogQ29saW4gS2luZyBbbWFp
bHRvOmNvbGluLmtpbmdAY2Fub25pY2FsLmNvbV0NCj4gU2VudDogVGh1cnNkYXksIE5vdmVtYmVy
IDI2LCAyMDIwIDI6NTYgQU0NCj4gVG86IFNvbmcgQmFvIEh1YSAoQmFycnkgU29uZykgPHNvbmcu
YmFvLmh1YUBoaXNpbGljb24uY29tPjsgQ2hyaXN0b3BoDQo+IEhlbGx3aWcgPGhjaEBsc3QuZGU+
OyBNYXJlayBTenlwcm93c2tpIDxtLnN6eXByb3dza2lAc2Ftc3VuZy5jb20+Ow0KPiBSb2JpbiBN
dXJwaHkgPHJvYmluLm11cnBoeUBhcm0uY29tPjsgaW9tbXVAbGlzdHMubGludXgtZm91bmRhdGlv
bi5vcmcNCj4gQ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bWFw
X2JlbmNobWFyay5jDQo+IGluZGV4IGNhNjE2YjY2NGY3Mi4uZTFlMzc2MDNkMDFiIDEwMDY0NA0K
PiAtLS0gYS9rZXJuZWwvZG1hL21hcF9iZW5jaG1hcmsuYw0KPiArKysgYi9rZXJuZWwvZG1hL21h
cF9iZW5jaG1hcmsuYw0KPiBAQCAtMTkyLDcgKzE5Miw3IEBAIHN0YXRpYyBsb25nIG1hcF9iZW5j
aG1hcmtfaW9jdGwoc3RydWN0IGZpbGUgKmZpbGUsDQo+IHVuc2lnbmVkIGludCBjbWQsDQo+ICAJ
CXVuc2lnbmVkIGxvbmcgYXJnKQ0KPiAgew0KPiAgCXN0cnVjdCBtYXBfYmVuY2htYXJrX2RhdGEg
Km1hcCA9IGZpbGUtPnByaXZhdGVfZGF0YTsNCj4gLQl2b2lkIF9fdXNlciAqYXJncCA9ICh2b2lk
IF9fdXNlciAqKWFyZ3A7DQo+ICsJdm9pZCBfX3VzZXIgKmFyZ3AgPSAodm9pZCBfX3VzZXIgKilh
cmc7DQo+ICAJdTY0IG9sZF9kbWFfbWFzazsNCj4gDQo+ICAJaW50IHJldDsNCj4gLS0NCj4gMi4y
OS4yDQoNClRoYW5rcw0KQmFycnkNCg0K
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment
@ 2020-11-25 18:22 ` Song Bao Hua (Barry Song)
0 siblings, 0 replies; 8+ messages in thread
From: Song Bao Hua (Barry Song) @ 2020-11-25 18:22 UTC (permalink / raw)
To: Colin King, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu@lists.linux-foundation.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
> -----Original Message-----
> From: Colin King [mailto:colin.king@canonical.com]
> Sent: Thursday, November 26, 2020 2:56 AM
> To: Song Bao Hua (Barry Song) <song.bao.hua@hisilicon.com>; Christoph
> Hellwig <hch@lst.de>; Marek Szyprowski <m.szyprowski@samsung.com>;
> Robin Murphy <robin.murphy@arm.com>; iommu@lists.linux-foundation.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in
> argp assignment
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The assignment of argp is currently using argp as the source because of
> a typo. Fix this by assigning it the value passed in arg instead.
>
> Addresses-Coverity: ("Uninitialized pointer read")
> Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming
> DMA APIs")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Barry Song <song.bao.hua@hisilicon.com>
> ---
> kernel/dma/map_benchmark.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
> index ca616b664f72..e1e37603d01b 100644
> --- a/kernel/dma/map_benchmark.c
> +++ b/kernel/dma/map_benchmark.c
> @@ -192,7 +192,7 @@ static long map_benchmark_ioctl(struct file *file,
> unsigned int cmd,
> unsigned long arg)
> {
> struct map_benchmark_data *map = file->private_data;
> - void __user *argp = (void __user *)argp;
> + void __user *argp = (void __user *)arg;
> u64 old_dma_mask;
>
> int ret;
> --
> 2.29.2
Thanks
Barry
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment
@ 2020-11-25 18:22 ` Song Bao Hua (Barry Song)
0 siblings, 0 replies; 8+ messages in thread
From: Song Bao Hua (Barry Song) @ 2020-11-25 18:22 UTC (permalink / raw)
To: Colin King, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu@lists.linux-foundation.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
> -----Original Message-----
> From: Colin King [mailto:colin.king@canonical.com]
> Sent: Thursday, November 26, 2020 2:56 AM
> To: Song Bao Hua (Barry Song) <song.bao.hua@hisilicon.com>; Christoph
> Hellwig <hch@lst.de>; Marek Szyprowski <m.szyprowski@samsung.com>;
> Robin Murphy <robin.murphy@arm.com>; iommu@lists.linux-foundation.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in
> argp assignment
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The assignment of argp is currently using argp as the source because of
> a typo. Fix this by assigning it the value passed in arg instead.
>
> Addresses-Coverity: ("Uninitialized pointer read")
> Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming
> DMA APIs")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Barry Song <song.bao.hua@hisilicon.com>
> ---
> kernel/dma/map_benchmark.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
> index ca616b664f72..e1e37603d01b 100644
> --- a/kernel/dma/map_benchmark.c
> +++ b/kernel/dma/map_benchmark.c
> @@ -192,7 +192,7 @@ static long map_benchmark_ioctl(struct file *file,
> unsigned int cmd,
> unsigned long arg)
> {
> struct map_benchmark_data *map = file->private_data;
> - void __user *argp = (void __user *)argp;
> + void __user *argp = (void __user *)arg;
> u64 old_dma_mask;
>
> int ret;
> --
> 2.29.2
Thanks
Barry
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment
2020-11-25 18:22 ` Song Bao Hua (Barry Song)
(?)
@ 2020-11-25 18:29 ` Christoph Hellwig
-1 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2020-11-25 18:29 UTC (permalink / raw)
To: Song Bao Hua (Barry Song)
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, Colin King, Robin Murphy,
Christoph Hellwig
Ooops, that was my edit. I'll make sure to fold the fix into the
original commit.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment
@ 2020-11-25 18:29 ` Christoph Hellwig
0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2020-11-25 18:29 UTC (permalink / raw)
To: Song Bao Hua (Barry Song)
Cc: Colin King, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
iommu@lists.linux-foundation.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Ooops, that was my edit. I'll make sure to fold the fix into the
original commit.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment
@ 2020-11-25 18:29 ` Christoph Hellwig
0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2020-11-25 18:29 UTC (permalink / raw)
To: Song Bao Hua (Barry Song)
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, Colin King, Robin Murphy,
Christoph Hellwig
Ooops, that was my edit. I'll make sure to fold the fix into the
original commit.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-11-25 18:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-25 13:55 [PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment Colin King
2020-11-25 13:55 ` Colin King
2020-11-25 18:22 ` Song Bao Hua (Barry Song)
2020-11-25 18:22 ` Song Bao Hua (Barry Song)
2020-11-25 18:22 ` Song Bao Hua (Barry Song)
2020-11-25 18:29 ` Christoph Hellwig
2020-11-25 18:29 ` Christoph Hellwig
2020-11-25 18:29 ` Christoph Hellwig
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.