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

From: Amit Shah
Date: Thu Oct 28 2021 - 07:55:01 EST


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://github.com/torvalds/linux/blob/master/drivers/char/virtio_console.c#L1282

Why don't you try it?

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