lkml.org 
[lkml]   [2008]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Fix sg_io_hdr.info corruption.
From
Date
sizeof(unsigned (short)) is actually sizeof(function), == 1.
Spotted by sparse.

Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
---
fs/compat_ioctl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 5235c67..7c2d617 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -784,7 +784,7 @@ static int sg_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)

if (copy_in_user(&sgio->status, &sgio32->status,
(4 * sizeof(unsigned char)) +
- (2 * sizeof(unsigned (short))) +
+ (2 * sizeof(unsigned short)) +
(3 * sizeof(int))))
return -EFAULT;



\
 
 \ /
  Last update: 2008-12-28 15:43    [W:0.081 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site