lkml.org 
[lkml]   [2022]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] nfp: fix use-after-free in area_cache_get()
On Sat,  6 Aug 2022 22:30:43 +0800 Jialiang Wang wrote:
> area_cache_get() calls cpp->op->area_init() and uses cache->area by
> nfp_cpp_area_priv(area), but in
> nfp_cpp_area_release()->nfp_cpp_area_put()->__release_cpp_area() we
> already freed the cache->area.
>
> To avoid the use-after-free, reallocate a piece of memory for the
> cache->area by nfp_cpp_area_alloc().
>
> Note: This vulnerability is triggerable by providing emulated device
> equipped with specified configuration.
>
> BUG: KASAN: use-after-free in nfp6000_area_init+0x74/0x1d0 [nfp]
> Write of size 4 at addr ffff888005b490a0 by task insmod/226
> Call Trace:
> <TASK>
> dump_stack_lvl+0x33/0x46
> print_report.cold.12+0xb2/0x6b7
> ? nfp6000_area_init+0x74/0x1d0 [nfp]
> kasan_report+0xa5/0x120
> ? nfp6000_area_init+0x74/0x1d0 [nfp]
> nfp6000_area_init+0x74/0x1d0 [nfp]
> area_cache_get.constprop.8+0x2da/0x360 [nfp]

Please provide more of the report, including the allocated at and freed
at sections and run the thing thru stack decode so we get the line
numbers.

\
 
 \ /
  Last update: 2022-08-08 21:17    [W:1.377 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site