lkml.org 
[lkml]   [2019]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] hyper-v: Check for ring buffer in hv_get_bytes_to_read/write
Date
From: Mohammed Gamal <mgamal@redhat.com> Sent: Thursday, March 7, 2019 8:36 AM
>
> This patch adds a check for the presence of the ring buffer in
> hv_get_bytes_to_read/write() to avoid possible NULL pointer dereferences.
> If the ring buffer is not yet allocated, return 0 bytes to be read/written.
>
> The root cause is that code that accesses the ring buffer including
> hv_get_bytes_to_read/write() could be vulnerable to the race condition
> discussed in https://lkml.org/lkml/2018/10/18/779>
>
> This race is being addressed by the patch series by Kimberly Brown in
> https://lkml.org/lkml/2019/2/21/1236 which is not final yet
>
> Signed-off-by: Mohammed Gamal <mgamal@redhat.com>

Could you elaborate on the code paths where
hv_get_bytes_to_read/write() could be called when the ring buffer
isn't yet allocated? My sense is that Kim Brown's patch will address
all of the code paths that involved sysfs access from outside the
driver. And within a driver, the ring buffer should never be accessed
unless it is already allocated. Is there another code path we're not
aware of? I'm wondering if these changes are really needed once
Kim Brown's patch is finished.

Michael

\
 
 \ /
  Last update: 2019-03-07 18:34    [W:0.065 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site