[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 03/25: Fix exec crash when setexecdata has never been called
From: |
Samuel Thibault |
Subject: |
[hurd] 03/25: Fix exec crash when setexecdata has never been called |
Date: |
Mon, 24 Oct 2016 00:16:44 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 1f78ddd5719d50d3af7140066316932ef00044cf
Author: Samuel Thibault <address@hidden>
Date: Sun Aug 28 21:12:05 2016 +0200
Fix exec crash when setexecdata has never been called
or called with a small array.
This notably happens when using a sub-exec, see BZ #48919.
* exec/hashexec.c (check_hashbang): Check std_nports before accessing
std_ports.
---
exec/hashexec.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/exec/hashexec.c b/exec/hashexec.c
index e53d2ee..6337f0a 100644
--- a/exec/hashexec.c
+++ b/exec/hashexec.c
@@ -97,22 +97,24 @@ check_hashbang (struct execdata *e,
mach_port_t port = ((which < nports &&
portarray[which] != MACH_PORT_NULL)
? portarray[which] :
- (flags & EXEC_DEFAULTS) ? std_ports[which]
- : MACH_PORT_NULL);
+ (flags & EXEC_DEFAULTS && which < std_nports)
+ ? std_ports[which]
+ : MACH_PORT_NULL);
/* Reauthenticate dir ports if they are the defaults. */
switch (which)
{
case INIT_PORT_CRDIR:
/* If secure, always use the default root. */
- if ((flags & EXEC_SECURE) ||
- port == std_ports[which])
+ if ((which < std_nports && flags & EXEC_SECURE) ||
+ (which < std_nports && port == std_ports[which]))
return (reauthenticate (std_ports[which], &user_crdir) ?:
(*operate) (user_crdir));
break;
case INIT_PORT_CWDIR:
/* If secure, reauthenticate cwd whether default or given. */
- if ((flags & EXEC_SECURE) || port == std_ports[which])
+ if ((flags & EXEC_SECURE) ||
+ (which < std_nports && port == std_ports[which]))
return (reauthenticate (port, &user_cwdir) ?:
(*operate) (user_cwdir));
break;
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (12576ff -> 341f43d), Samuel Thibault, 2016/10/23
- [hurd] 01/25: remap: Refuse non-absolute paths, Samuel Thibault, 2016/10/23
- [hurd] 04/25: Fix message about not being able to request shutdown notification, Samuel Thibault, 2016/10/23
- [hurd] 02/25: typo, Samuel Thibault, 2016/10/23
- [hurd] 07/25: Fix looping over runsystem possibilities, Samuel Thibault, 2016/10/23
- [hurd] 03/25: Fix exec crash when setexecdata has never been called,
Samuel Thibault <=
- [hurd] 05/25: exec: Fix loading binaries without a memory manager object, Samuel Thibault, 2016/10/23
- [hurd] 10/25: Fix patch to runsystem.hurd, Samuel Thibault, 2016/10/23
- [hurd] 20/25: console-client: Remove unused variable., Samuel Thibault, 2016/10/23
- [hurd] 19/25: ext2fs: Poison pointers into dereferenced cache pages., Samuel Thibault, 2016/10/23
- [hurd] 08/25: libfshelp: acquire references to control ports, Samuel Thibault, 2016/10/23
- [hurd] 15/25: Avoid fatal error handling in option parsers., Samuel Thibault, 2016/10/23
- [hurd] 25/25: boot: Ignore EINTR., Samuel Thibault, 2016/10/23
- [hurd] 24/25: Avoid warnings if increasing a threads priority fails., Samuel Thibault, 2016/10/23
- [hurd] 18/25: ext2fs: Rename parameter., Samuel Thibault, 2016/10/23
- [hurd] 09/25: Fix installing runsystem.hurd, Samuel Thibault, 2016/10/23