Re: [PATCH 1/2] tty: vcc: zero-initialize control packet in vcc_send_ctl()

Jiri Slaby <[email protected]> Fri, 31 Jul 2026 10:29:14 +0200
Newsgroups gmane.linux.serial,gmane.linux.ports.sparc,gmane.linux.kernel,gmane.linux.kernel.stable
Message-ID <[email protected]>
On 31. 07. 26, 10:15, Greg Kroah-Hartman wrote:
> From: Joshua Rogers <[email protected]>
> 
> The stack-allocated struct vio_vcc pkt was partially initialized,
> leaving the tag.stype_env field uninitialized before being sent via
> ldc_write(), potentially leaking kernel stack data to the LDC peer.
> 
> Assisted-by: AISLE:Snapshot
> Cc: stable <[email protected]>
> Signed-off-by: Joshua Rogers <[email protected]>
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
> ---
>   drivers/tty/vcc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
> index 27a55465bf5e..3947bd2b75ac 100644
> --- a/drivers/tty/vcc.c
> +++ b/drivers/tty/vcc.c
> @@ -492,7 +492,7 @@ static ssize_t domain_show(struct device *dev,
>   
>   static int vcc_send_ctl(struct vcc_port *port, int ctl)
>   {
> -	struct vio_vcc pkt;
> +	struct vio_vcc pkt = {};

Note this needs not initialize holes. I believe there are none here, but 
memset() is usually preferred/safer.

thanks,
-- 
js
suse labs