diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-01-05 01:32:49 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-01-05 01:32:49 +0100 |
commit | 05a15f8c43e7a167983f19bd866b90158661703e (patch) | |
tree | a71d747f75f2155f49eb04e32ef0066b0a89dd4c /lwip | |
parent | 89c9590e020e1372cfab037b7789aaef89b4f544 (diff) | |
download | hurd-05a15f8c43e7a167983f19bd866b90158661703e.tar.gz hurd-05a15f8c43e7a167983f19bd866b90158661703e.tar.bz2 hurd-05a15f8c43e7a167983f19bd866b90158661703e.zip |
lwip,pfinet: Fix crash on make_sock_user getting EINTR
_ports_create_port_internal may return EINTR.
* lwip/port-objs.c (make_sock_user): Set errno when ports_create_port
returns an error.
* pfinet/socket.c (make_sock_user): Likewise.
* lwip/io-ops.c (lwip_S_io_reauthenticate): Loop while make_sock_user
errors with EINTR.
* pfinet/io-ops.c (S_io_reauthenticate): Likewise.
Diffstat (limited to 'lwip')
-rw-r--r-- | lwip/io-ops.c | 6 | ||||
-rw-r--r-- | lwip/port-objs.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lwip/io-ops.c b/lwip/io-ops.c index 89d596a4..2e666ab2 100644 --- a/lwip/io-ops.c +++ b/lwip/io-ops.c @@ -317,7 +317,11 @@ lwip_S_io_reauthenticate (struct sock_user * user, mach_port_t rend) aux_uids = aubuf; aux_gids = agbuf; - newuser = make_sock_user (user->sock, 0, 1, 0); + do + newuser = make_sock_user (user->sock, 0, 1, 0); + while (!newuser && errno == EINTR); + if (!newuser) + return 0; auth = getauth (); newright = ports_get_send_right (newuser); diff --git a/lwip/port-objs.c b/lwip/port-objs.c index 07bcab8f..70e1aeaf 100644 --- a/lwip/port-objs.c +++ b/lwip/port-objs.c @@ -118,7 +118,10 @@ make_sock_user (struct socket *sock, int isroot, int noinstall, int consume) err = ports_create_port (socketport_class, lwip_bucket, sizeof (struct sock_user), &user); if (err) - return 0; + { + errno = err; + return 0; + } if (!consume) refcount_ref (&sock->refcnt); |