Re: [PATCH] arch: sparc: kernel: check the memory length before use strcpy().

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

 



From: Chen Gang <gang.chen@xxxxxxxxxxx>
Date: Sat, 22 Jun 2013 13:26:09 +0800

> 
> For the related next strcpy(), the destination length is less than 512,
> but the source maximize length may be 'OPROMMAXPARAM' (4096) which is
> more than 512.
> 
> One work flow may:
>   openprom_sunos_ioctl() ->  if (cmd == OPROMSETOPT)
>     getstrings() ->  will alloc buffer with size 'OPROMMAXPARAM'.
>     opromsetopt() ->  devide the buffer into 'var' and 'value'
>       of_set_property() -> pass
>         prom_setprop() -> pass
>           ldom_set_var()
> 
> And do not mind the additional 4 alignment buffer increasing, since
> 'sizeof(pkt) - sizeof(pkt.header)' is 4 alignment at least.
> 
> 
> Signed-off-by: Chen Gang <gang.chen@xxxxxxxxxxx>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux