Skip to content

Commit 7326fff

Browse files
ausyskingregkh
authored andcommitted
mei: validate request value in client notify request ioctl
This patch address a possible security issue: The request field in client notify request ioctl comes from user space as u32 and is downcasted to u8 with out validation. Check request field to have approved values MEI_HBM_NOTIFICATION_STAR/STOP Cc: <stable@vger.kernel.org> #4.3+ Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 92e963f commit 7326fff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/misc/mei/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,11 @@ static int mei_ioctl_client_notify_request(struct file *file, u32 request)
458458
{
459459
struct mei_cl *cl = file->private_data;
460460

461-
return mei_cl_notify_request(cl, file, request);
461+
if (request != MEI_HBM_NOTIFICATION_START &&
462+
request != MEI_HBM_NOTIFICATION_STOP)
463+
return -EINVAL;
464+
465+
return mei_cl_notify_request(cl, file, (u8)request);
462466
}
463467

464468
/**

0 commit comments

Comments
 (0)