lkml.org 
[lkml]   [2021]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] ipw2x00: Use struct_size helper instead of open-coded arithmetic
On Sat, 17 Jul 2021 at 18:25, Len Baker <len.baker@gmx.com> wrote:
>
> Dynamic size calculations (especially multiplication) should not be
> performed in memory allocator function arguments due to the risk of them
> overflowing. This could lead to values wrapping around and a smaller
> allocation being made than the caller was expecting. Using those
> allocations could lead to linear overflows of heap memory and other
> misbehaviors.
>
> To avoid this scenario, use the struct_size helper.
>
> Signed-off-by: Len Baker <len.baker@gmx.com>
> ---
> drivers/net/wireless/intel/ipw2x00/libipw_tx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Looks fine, thanks!

Stanislav.

\
 
 \ /
  Last update: 2021-07-21 12:38    [W:0.692 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site