FreeBSD Bugzilla – Attachment 166215 Details for
Bug 206699
[Hyper-V]FreeBSD potential NULL pointer dereference in storage bounce buffer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix the NULL pointer dereference
LIST_EMPTY_CHECK.patch (text/plain), 1.32 KB, created by
Hongjiang
on 2016-01-28 01:33:25 UTC
(
hide
)
Description:
Patch to fix the NULL pointer dereference
Filename:
MIME Type:
Creator:
Hongjiang
Created:
2016-01-28 01:33:25 UTC
Size:
1.32 KB
patch
obsolete
>Index: sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c >=================================================================== >--- sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c (revision 294703) >+++ sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c (working copy) >@@ -1525,12 +1525,12 @@ > { > struct hv_sgl_node *sgl_node = NULL; > >- sgl_node = LIST_FIRST(&g_hv_sgl_page_pool.in_use_sgl_list); >- LIST_REMOVE(sgl_node, link); >- if (NULL == sgl_node) { >+ if (LIST_EMPTY(&g_hv_sgl_page_pool.in_use_sgl_list)) { > printf("storvsc error: not enough in use sgl\n"); > return; > } >+ sgl_node = LIST_FIRST(&g_hv_sgl_page_pool.in_use_sgl_list); >+ LIST_REMOVE(sgl_node, link); > sgl_node->sgl_data = sgl; > LIST_INSERT_HEAD(&g_hv_sgl_page_pool.free_sgl_list, sgl_node, link); > } >@@ -1556,12 +1556,12 @@ > struct hv_sgl_node *sgl_node = NULL; > > /* get struct sglist from free_sgl_list */ >- sgl_node = LIST_FIRST(&g_hv_sgl_page_pool.free_sgl_list); >- LIST_REMOVE(sgl_node, link); >- if (NULL == sgl_node) { >+ if (LIST_EMPTY(&g_hv_sgl_page_pool.free_sgl_list)) { > printf("storvsc error: not enough free sgl\n"); > return NULL; > } >+ sgl_node = LIST_FIRST(&g_hv_sgl_page_pool.free_sgl_list); >+ LIST_REMOVE(sgl_node, link); > bounce_sgl = sgl_node->sgl_data; > LIST_INSERT_HEAD(&g_hv_sgl_page_pool.in_use_sgl_list, sgl_node, link); > >@@ -1924,6 +1924,64 @@ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 206699
: 166215