回复: 回复: drivers/char: suspected null-pointer dereference problem in handle_control_message

From: YE Chengfeng
Date: Sat Oct 30 2021 - 09:35:57 EST


If it's possible as said, maybe it should be fixed?
Do you need my help to send a patch?

-----邮件原件-----
发件人: Amit Shah <amit@xxxxxxxxxxxxx>
发送时间: 2021年10月28日 19:55
收件人: YE Chengfeng <cyeaa@xxxxxxxxxxxxxx>; amit@xxxxxxxxxx; arnd@xxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
主题: Re: 回复: drivers/char: suspected null-pointer dereference problem in handle_control_message

On Tue, 2021-10-26 at 11:51 +0000, YE Chengfeng wrote:
> Thanks for your reply.
>
> Agree with you, seems that the branch at #line 1573 already handles this situation.
>
> Another question, is it possible that port->name is null when show_port_name is invoked? I don't see any null-check there, could it be a null-dereference problem at #line 1282? Link is below.
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftorvalds%2Flinux%2Fblob%2Fmaster%2Fdrivers%2Fchar%2Fvirtio_console.c%23L1282&amp;data=04%7C01%7Ccyeaa%40connect.ust.hk%7Cf78df542482244275a4408d99a09c159%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C637710188967881644%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=TGc89qYoAYheHQOvDkMCpAtvNJz6muw9zC8nhQXAQ0E%3D&amp;reserved=0

Why don't you try it?

It's certainly possible that a port doesn't have a name.