Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mei: make a local copy of client uuid in connect

Connect ioctl has the same memory for in and out parameters.
Copy in parameter (client uuid) to the local stack to avoid it be
overwritten by out parameters fill.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250918130435.3327400-3-alexander.usyskin@intel.com

authored by

Alexander Usyskin and committed by
Greg Kroah-Hartman
bb29fc32 2cedb296

+9 -9
+9 -9
drivers/misc/mei/main.c
··· 646 646 struct mei_cl *cl = file->private_data; 647 647 struct mei_connect_client_data conn; 648 648 struct mei_connect_client_data_vtag conn_vtag; 649 - const uuid_le *cl_uuid; 649 + uuid_le cl_uuid; 650 650 struct mei_client *props; 651 651 u8 vtag; 652 652 u32 notify_get, notify_req; ··· 674 674 rets = -EFAULT; 675 675 goto out; 676 676 } 677 - cl_uuid = &conn.in_client_uuid; 677 + cl_uuid = conn.in_client_uuid; 678 678 props = &conn.out_client_properties; 679 679 vtag = 0; 680 680 681 - rets = mei_vt_support_check(dev, cl_uuid); 681 + rets = mei_vt_support_check(dev, &cl_uuid); 682 682 if (rets == -ENOTTY) 683 683 goto out; 684 684 if (!rets) 685 - rets = mei_ioctl_connect_vtag(file, cl_uuid, props, 685 + rets = mei_ioctl_connect_vtag(file, &cl_uuid, props, 686 686 vtag); 687 687 else 688 - rets = mei_ioctl_connect_client(file, cl_uuid, props); 688 + rets = mei_ioctl_connect_client(file, &cl_uuid, props); 689 689 if (rets) 690 690 goto out; 691 691 ··· 707 707 goto out; 708 708 } 709 709 710 - cl_uuid = &conn_vtag.connect.in_client_uuid; 710 + cl_uuid = conn_vtag.connect.in_client_uuid; 711 711 props = &conn_vtag.out_client_properties; 712 712 vtag = conn_vtag.connect.vtag; 713 713 714 - rets = mei_vt_support_check(dev, cl_uuid); 714 + rets = mei_vt_support_check(dev, &cl_uuid); 715 715 if (rets == -EOPNOTSUPP) 716 716 cl_dbg(dev, cl, "FW Client %pUl does not support vtags\n", 717 - cl_uuid); 717 + &cl_uuid); 718 718 if (rets) 719 719 goto out; 720 720 ··· 724 724 goto out; 725 725 } 726 726 727 - rets = mei_ioctl_connect_vtag(file, cl_uuid, props, vtag); 727 + rets = mei_ioctl_connect_vtag(file, &cl_uuid, props, vtag); 728 728 if (rets) 729 729 goto out; 730 730