linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/crypto: suspected null-pointer dereference at atmel_sha_init
@ 2021-10-26  9:07 YE Chengfeng
  2021-10-27  2:55 ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: YE Chengfeng @ 2021-10-26  9:07 UTC (permalink / raw)
  To: herbert, davem, nicolas.ferre, alexandre.belloni, ludovic.desroches
  Cc: linux-kernel

Hi,

https://github.com/torvalds/linux/blob/master/drivers/crypto/atmel-sha.c#L431

We notice that the return pointer of atmel_sha_find_dev could be null, and it seems that null-check is missing at #line 431. If it returns null pointer, there will be a null pointer dereference problem at #line 437. We check that other call sites of this interface perform null-check, while this doesn't, so we suspect that this could be a problem.

This is detected by our experimental static analysis tool, it could be false positive, so we manually check and report those we think may be true bugs. Would you like to have a look at them?

Thanks so much,
Chengfeng

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/crypto: suspected null-pointer dereference at atmel_sha_init
  2021-10-26  9:07 drivers/crypto: suspected null-pointer dereference at atmel_sha_init YE Chengfeng
@ 2021-10-27  2:55 ` Herbert Xu
  2021-10-27 11:11   ` 回复: " YE Chengfeng
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2021-10-27  2:55 UTC (permalink / raw)
  To: YE Chengfeng
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches, linux-kernel

On Tue, Oct 26, 2021 at 09:07:43AM +0000, YE Chengfeng wrote:
> Hi,
> 
> https://github.com/torvalds/linux/blob/master/drivers/crypto/atmel-sha.c#L431
> 
> We notice that the return pointer of atmel_sha_find_dev could be null, and it seems that null-check is missing at #line 431. If it returns null pointer, there will be a null pointer dereference problem at #line 437. We check that other call sites of this interface perform null-check, while this doesn't, so we suspect that this could be a problem.
> 
> This is detected by our experimental static analysis tool, it could be false positive, so we manually check and report those we think may be true bugs. Would you like to have a look at them?

It could be a real issue when the device is hot unplugged.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* 回复: drivers/crypto: suspected null-pointer dereference at atmel_sha_init
  2021-10-27  2:55 ` Herbert Xu
@ 2021-10-27 11:11   ` YE Chengfeng
  2021-10-30 13:37     ` YE Chengfeng
  0 siblings, 1 reply; 4+ messages in thread
From: YE Chengfeng @ 2021-10-27 11:11 UTC (permalink / raw)
  To: Herbert Xu
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches, linux-kernel

Thanks for your reply!

Do you need us help you to provide a patch to fix it?

Best regards,
Chengfeng

-----邮件原件-----
发件人: Herbert Xu <herbert@gondor.apana.org.au> 
发送时间: 2021年10月27日 10:56
收件人: YE Chengfeng <cyeaa@connect.ust.hk>
抄送: davem@davemloft.net; nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com; ludovic.desroches@microchip.com; linux-kernel@vger.kernel.org
主题: Re: drivers/crypto: suspected null-pointer dereference at atmel_sha_init

On Tue, Oct 26, 2021 at 09:07:43AM +0000, YE Chengfeng wrote:
> Hi,
> 
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Ftorvalds%2Flinux%2Fblob%2Fmaster%2Fdrivers%2Fcrypto%2Fatmel-s
> ha.c%23L431&amp;data=04%7C01%7Ccyeaa%40connect.ust.hk%7C83edd64969f444
> 64edf608d998f54ac1%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C637709
> 001562266287%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM
> zIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=5HYshMZFegruxmG%2Bu
> nxw%2F2LF5lrTGFt%2FgTaKbNIKiv8%3D&amp;reserved=0
> 
> We notice that the return pointer of atmel_sha_find_dev could be null, and it seems that null-check is missing at #line 431. If it returns null pointer, there will be a null pointer dereference problem at #line 437. We check that other call sites of this interface perform null-check, while this doesn't, so we suspect that this could be a problem.
> 
> This is detected by our experimental static analysis tool, it could be false positive, so we manually check and report those we think may be true bugs. Would you like to have a look at them?

It could be a real issue when the device is hot unplugged.

Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgondor.apana.org.au%2F~herbert%2F&amp;data=04%7C01%7Ccyeaa%40connect.ust.hk%7C83edd64969f44464edf608d998f54ac1%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C637709001562266287%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=5h6aT%2FpRjy3GRzb%2FGbGTA3INxe8xsSEENTVa1Jl09Qg%3D&amp;reserved=0
PGP Key: https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgondor.apana.org.au%2F~herbert%2Fpubkey.txt&amp;data=04%7C01%7Ccyeaa%40connect.ust.hk%7C83edd64969f44464edf608d998f54ac1%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C637709001562276244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PYlSTQdb0j9gdasnQ0YJq3ktqNlxalxyKetM%2BJCKiFc%3D&amp;reserved=0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* 回复: drivers/crypto: suspected null-pointer dereference at atmel_sha_init
  2021-10-27 11:11   ` 回复: " YE Chengfeng
@ 2021-10-30 13:37     ` YE Chengfeng
  0 siblings, 0 replies; 4+ messages in thread
From: YE Chengfeng @ 2021-10-30 13:37 UTC (permalink / raw)
  To: Herbert Xu
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches, linux-kernel

I send a patch for it.

Best regards,
Chengfeng

-----邮件原件-----
发件人: YE Chengfeng 
发送时间: 2021年10月27日 19:12
收件人: Herbert Xu <herbert@gondor.apana.org.au>
抄送: davem@davemloft.net; nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com; ludovic.desroches@microchip.com; linux-kernel@vger.kernel.org
主题: 回复: drivers/crypto: suspected null-pointer dereference at atmel_sha_init

Thanks for your reply!

Do you need us help you to provide a patch to fix it?

Best regards,
Chengfeng

-----邮件原件-----
发件人: Herbert Xu <herbert@gondor.apana.org.au> 
发送时间: 2021年10月27日 10:56
收件人: YE Chengfeng <cyeaa@connect.ust.hk>
抄送: davem@davemloft.net; nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com; ludovic.desroches@microchip.com; linux-kernel@vger.kernel.org
主题: Re: drivers/crypto: suspected null-pointer dereference at atmel_sha_init

On Tue, Oct 26, 2021 at 09:07:43AM +0000, YE Chengfeng wrote:
> Hi,
> 
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Ftorvalds%2Flinux%2Fblob%2Fmaster%2Fdrivers%2Fcrypto%2Fatmel-s
> ha.c%23L431&amp;data=04%7C01%7Ccyeaa%40connect.ust.hk%7C83edd64969f444
> 64edf608d998f54ac1%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C637709
> 001562266287%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM
> zIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=5HYshMZFegruxmG%2Bu
> nxw%2F2LF5lrTGFt%2FgTaKbNIKiv8%3D&amp;reserved=0
> 
> We notice that the return pointer of atmel_sha_find_dev could be null, and it seems that null-check is missing at #line 431. If it returns null pointer, there will be a null pointer dereference problem at #line 437. We check that other call sites of this interface perform null-check, while this doesn't, so we suspect that this could be a problem.
> 
> This is detected by our experimental static analysis tool, it could be false positive, so we manually check and report those we think may be true bugs. Would you like to have a look at them?

It could be a real issue when the device is hot unplugged.

Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgondor.apana.org.au%2F~herbert%2F&amp;data=04%7C01%7Ccyeaa%40connect.ust.hk%7C83edd64969f44464edf608d998f54ac1%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C637709001562266287%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=5h6aT%2FpRjy3GRzb%2FGbGTA3INxe8xsSEENTVa1Jl09Qg%3D&amp;reserved=0
PGP Key: https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgondor.apana.org.au%2F~herbert%2Fpubkey.txt&amp;data=04%7C01%7Ccyeaa%40connect.ust.hk%7C83edd64969f44464edf608d998f54ac1%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C637709001562276244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PYlSTQdb0j9gdasnQ0YJq3ktqNlxalxyKetM%2BJCKiFc%3D&amp;reserved=0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-30 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-26  9:07 drivers/crypto: suspected null-pointer dereference at atmel_sha_init YE Chengfeng
2021-10-27  2:55 ` Herbert Xu
2021-10-27 11:11   ` 回复: " YE Chengfeng
2021-10-30 13:37     ` YE Chengfeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).