[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT/LWIP PATCH] liblwip: Remove vfscore_put_fd from socket_close



Hi Sharan,

indeed, I just had a look. Good catch.

Reviewed-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>

As an aside: it's amazing how bugs like this can slide past on kvm tests, just because unikraft of kvm happily dereferences null pointers and writes to address 0. Maybe it's time to set up the page table in a way that writes to such very low virtual addresses produce a page fault. That's probably the behavior most application programmers expect (and we already have that behavior on linuxu, and AFAIR on Xen, too).

On 5/27/19 3:00 PM, Sharan Santhanam wrote:
This patch fixes a bug in the function sock_net_close. The close
function frees up a descriptor that was removed by fdrop. The fdrop
function invokes the close callback after it had removed the fd
from its list.

Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
---
  sockets.c | 2 --
  1 file changed, 2 deletions(-)

diff --git a/sockets.c b/sockets.c
index 0cf22de..bbee72b 100644
--- a/sockets.c
+++ b/sockets.c
@@ -169,8 +169,6 @@ static int sock_net_close(struct vnode *s_vnode,
/* Close and release the lwip socket */
        ret = lwip_close(file->sock_fd);
-       /* Release the file descriptor number */
-       vfscore_put_fd(file->vfscore_file.fd);
        /* Free socket vnode */
        uk_free(uk_alloc_get_default(), file->vfscore_file.f_dentry->d_vnode);
        /* Free socket dentry */


--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.