lkml.org 
[lkml]   [2021]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 1/4] sgl_alloc_order: remove 4 GiB limit, sgl_free() warning
On Mon, Jan 18, 2021 at 08:27:09PM -0500, Douglas Gilbert wrote:

> To protect against the "unsigned long long" length being too big why
> not pick a large power of two and if someone can justify a larger
> value, they can send a patch.
>
> if (length > 64ULL * 1024 * 1024 * 1024)
> return NULL;

That is not how we protect against arithemetic overflows in the kernel

Jason

\
 
 \ /
  Last update: 2021-01-19 14:41    [W:0.133 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site