lkml.org 
[lkml]   [2018]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] xen: Fix two possible sleep-in-atomic-context bugs in create_active()
From
Date
On 20/06/18 04:38, Jia-Ju Bai wrote:
> The driver may sleep with holding a spinlock.
> The function call paths (from bottom to top) in Linux-4.16.7 are:
>
> [FUNC] __get_free_pages(GFP_KERNEL)
> drivers/xen/pvcalls-front.c, 351: __get_free_pages in create_active
> drivers/xen/pvcalls-front.c, 800: create_active in pvcalls_front_accept
> drivers/xen/pvcalls-front.c, 783: spin_lock in pvcalls_front_accept
>
> [FUNC] __get_free_pages(GFP_KERNEL)
> drivers/xen/pvcalls-front.c, 347: __get_free_pages in create_active
> drivers/xen/pvcalls-front.c, 800: create_active in pvcalls_front_accept
> drivers/xen/pvcalls-front.c, 783: spin_lock in pvcalls_front_accept
>
> To fix these bugs, GFP_KERNEL is replaced with GFP_ATOMIC.
>
> These bugs are found by my static analysis tool (DSAC-2) and checked by my
> code review.
>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

\
 
 \ /
  Last update: 2018-06-20 11:04    [W:0.075 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site