Skip to content

Commit bb29fc3

Browse files
ausyskingregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2cedb29 commit bb29fc3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/misc/mei/main.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
646646
struct mei_cl *cl = file->private_data;
647647
struct mei_connect_client_data conn;
648648
struct mei_connect_client_data_vtag conn_vtag;
649-
const uuid_le *cl_uuid;
649+
uuid_le cl_uuid;
650650
struct mei_client *props;
651651
u8 vtag;
652652
u32 notify_get, notify_req;
@@ -674,18 +674,18 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
674674
rets = -EFAULT;
675675
goto out;
676676
}
677-
cl_uuid = &conn.in_client_uuid;
677+
cl_uuid = conn.in_client_uuid;
678678
props = &conn.out_client_properties;
679679
vtag = 0;
680680

681-
rets = mei_vt_support_check(dev, cl_uuid);
681+
rets = mei_vt_support_check(dev, &cl_uuid);
682682
if (rets == -ENOTTY)
683683
goto out;
684684
if (!rets)
685-
rets = mei_ioctl_connect_vtag(file, cl_uuid, props,
685+
rets = mei_ioctl_connect_vtag(file, &cl_uuid, props,
686686
vtag);
687687
else
688-
rets = mei_ioctl_connect_client(file, cl_uuid, props);
688+
rets = mei_ioctl_connect_client(file, &cl_uuid, props);
689689
if (rets)
690690
goto out;
691691

@@ -707,14 +707,14 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
707707
goto out;
708708
}
709709

710-
cl_uuid = &conn_vtag.connect.in_client_uuid;
710+
cl_uuid = conn_vtag.connect.in_client_uuid;
711711
props = &conn_vtag.out_client_properties;
712712
vtag = conn_vtag.connect.vtag;
713713

714-
rets = mei_vt_support_check(dev, cl_uuid);
714+
rets = mei_vt_support_check(dev, &cl_uuid);
715715
if (rets == -EOPNOTSUPP)
716716
cl_dbg(dev, cl, "FW Client %pUl does not support vtags\n",
717-
cl_uuid);
717+
&cl_uuid);
718718
if (rets)
719719
goto out;
720720

@@ -724,7 +724,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
724724
goto out;
725725
}
726726

727-
rets = mei_ioctl_connect_vtag(file, cl_uuid, props, vtag);
727+
rets = mei_ioctl_connect_vtag(file, &cl_uuid, props, vtag);
728728
if (rets)
729729
goto out;
730730

0 commit comments

Comments
 (0)