Re: [PATCH RESEND] of: module: add buffer overflow check in of_modalias()

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

 



On Sun, Apr 14, 2024 at 11:51:39AM +0300, Sergey Shtylyov wrote:
> In of_modalias(), if the buffer happens to be too small even for the 1st
> snprintf() call, the len parameter will become negative and str parameter
> (if not NULL initially) will point beyond the buffer's end. Add the buffer
> overflow check after the 1st snprintf() call and fix such check after the
> strlen() call (accounting for the terminating NUL char).
> 
> Fixes: bc575064d688 ("of/device: use of_property_for_each_string to parse compatible strings")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@xxxxxx>
> 
> ---
> The patch is against the dt/linus branch of Rob Herring's linux.git repo...
> 
>  drivers/of/module.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Applied, thanks.




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux