lkml.org 
[lkml]   [2019]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BUG] Use of probe_kernel_address() in task_rcu_dereference() without checking return value
On 08/30, Linus Torvalds wrote:
>
> Side note: that code had better not be performance-critical, because
> "probe_kernel_address()" is actually really really slow.

Yes, please see

[PATCH 2/3] introduce probe_slab_address()
https://lore.kernel.org/lkml/20141027195425.GC11736@redhat.com/

I sent 5 years ago ;) Do you think

/*
* Same as probe_kernel_address(), but @addr must be the valid pointer
* to a slab object, potentially freed/reused/unmapped.
*/
#ifdef CONFIG_DEBUG_PAGEALLOC
#define probe_slab_address(addr, retval) \
probe_kernel_address(addr, retval)
#else
#define probe_slab_address(addr, retval) \
({ \
(retval) = *(typeof(retval) *)(addr); \
0; \
})
#endif

can work?

Oleg.

\
 
 \ /
  Last update: 2019-08-30 18:10    [W:0.158 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site