Skip to content

Commit b1d353a

Browse files
Dan Carpenterdvhart
authored andcommitted
intel_scu_ipcutil: underflow in scu_reg_access()
"count" is controlled by the user and it can be negative. Let's prevent that by making it unsigned. You have to have CAP_SYS_RAWIO to call this function so the bug is not as serious as it could be. Fixes: 5369c02 ('intel_scu_ipc: Utility driver for intel scu ipc') Signed-off-by: Dan Carpenter <[email protected]> Cc: [email protected] Signed-off-by: Darren Hart <[email protected]>
1 parent 1c319e7 commit b1d353a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/x86/intel_scu_ipcutil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct scu_ipc_data {
4949

5050
static int scu_reg_access(u32 cmd, struct scu_ipc_data *data)
5151
{
52-
int count = data->count;
52+
unsigned int count = data->count;
5353

5454
if (count == 0 || count == 3 || count > 4)
5555
return -EINVAL;

0 commit comments

Comments
 (0)