Re: [PATCH] Fix sg_io_hdr.info corruption.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 28 Dec 2008 17:50:35 +0300
Alexey Zaytsev <alexey.zaytsev@xxxxxxxxx> wrote:

> sizeof(unsigned (short)) is actually sizeof(function), == 1.
> Spotted by sparse.
> 
> Signed-off-by: Alexey Zaytsev <alexey.zaytsev@xxxxxxxxx>
> ---
>  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;

gack.

akpm:/home/akpm> cat t.c
main()
{
	        printf("%d\n", sizeof(unsigned (short)));
	        printf("%d\n", sizeof(unsigned short));
}
akpm:/home/akpm> ./a.out
1
2


the code has been like this for years and years.  Why hasn't anyone
noticed?  
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux