public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/13134] New: posix_spawn() invokes sh on unknown executable image types
@ 2011-08-25 20:46 shea at shealevy dot com
  2011-08-25 20:46 ` [Bug libc/13134] " shea at shealevy dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: shea at shealevy dot com @ 2011-08-25 20:46 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13134

             Bug #: 13134
           Summary: posix_spawn() invokes sh on unknown executable image
                    types
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: shea@shealevy.com
    Classification: Unclassified


The current glibc implementation of posix_spawn() invokes /bin/sh if execve
sets errno to ENOEXEC. This is not specified by the POSIX.2004 definition
(http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html), is
different from the behavior of the sample implementation in the POSIX.2004
rationale section
(http://pubs.opengroup.org/onlinepubs/009604599/xrat/xsh_chap03.html), and
seems to have the same security risks that system() and popen() do in
set{u,g}id executables. In particular, the Rationale section says "The
effective behavior of a successful invocation of posix_spawn() is as if the
operation were implemented with POSIX operations as follows:", which as I've
said is followed by an implementation that behaves differently than the glibc
posix_spawn(). This appears to be non-compliant behavior.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/13134] posix_spawn() invokes sh on unknown executable image types
  2011-08-25 20:46 [Bug libc/13134] New: posix_spawn() invokes sh on unknown executable image types shea at shealevy dot com
@ 2011-08-25 20:46 ` shea at shealevy dot com
  2011-08-26  6:13 ` bugdal at aerifal dot cx
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: shea at shealevy dot com @ 2011-08-25 20:46 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13134

Shea Levy <shea at shealevy dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shea at shealevy dot com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/13134] posix_spawn() invokes sh on unknown executable image types
  2011-08-25 20:46 [Bug libc/13134] New: posix_spawn() invokes sh on unknown executable image types shea at shealevy dot com
  2011-08-25 20:46 ` [Bug libc/13134] " shea at shealevy dot com
@ 2011-08-26  6:13 ` bugdal at aerifal dot cx
  2011-08-26  8:36 ` shea at shealevy dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugdal at aerifal dot cx @ 2011-08-26  6:13 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13134

Rich Felker <bugdal at aerifal dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugdal at aerifal dot cx

--- Comment #1 from Rich Felker <bugdal at aerifal dot cx> 2011-08-26 06:12:58 UTC ---
Confirmed. My cynical prediction is that this bug will be ignored either for
"compatibility reasons" or because of the fact that someone obviously went to a
bit of trouble to write that completely wrong code for shell invocation that
doesn't even belong in spawni.c. Please prove me wrong...

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/13134] posix_spawn() invokes sh on unknown executable image types
  2011-08-25 20:46 [Bug libc/13134] New: posix_spawn() invokes sh on unknown executable image types shea at shealevy dot com
  2011-08-25 20:46 ` [Bug libc/13134] " shea at shealevy dot com
  2011-08-26  6:13 ` bugdal at aerifal dot cx
@ 2011-08-26  8:36 ` shea at shealevy dot com
  2011-09-06  0:27 ` drepper.fsp at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: shea at shealevy dot com @ 2011-08-26  8:36 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13134

--- Comment #2 from Shea Levy <shea at shealevy dot com> 2011-08-26 08:35:19 UTC ---
Created attachment 5915
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5915
Trivial fix

This patch removes the non-compliant behaviour.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/13134] posix_spawn() invokes sh on unknown executable image types
  2011-08-25 20:46 [Bug libc/13134] New: posix_spawn() invokes sh on unknown executable image types shea at shealevy dot com
                   ` (2 preceding siblings ...)
  2011-08-26  8:36 ` shea at shealevy dot com
@ 2011-09-06  0:27 ` drepper.fsp at gmail dot com
  2011-09-06  0:38 ` shea at shealevy dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-09-06  0:27 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13134

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-09-06 00:26:50 UTC ---
You really don't know what binary compatibility means, right?  git contains a
change.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/13134] posix_spawn() invokes sh on unknown executable image types
  2011-08-25 20:46 [Bug libc/13134] New: posix_spawn() invokes sh on unknown executable image types shea at shealevy dot com
                   ` (3 preceding siblings ...)
  2011-09-06  0:27 ` drepper.fsp at gmail dot com
@ 2011-09-06  0:38 ` shea at shealevy dot com
  2014-06-27 12:15 ` fweimer at redhat dot com
  2020-12-26 15:59 ` bruno at clisp dot org
  6 siblings, 0 replies; 8+ messages in thread
From: shea at shealevy dot com @ 2011-09-06  0:38 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13134

--- Comment #4 from Shea Levy <shea at shealevy dot com> 2011-09-06 00:38:09 UTC ---
(In reply to comment #3)
> You really don't know what binary compatibility means, right?  git contains a
> change.

Sorry, my fix was far too naive. I shouldn't have submitted that patch at all
if I wasn't going to take the time to get it right.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/13134] posix_spawn() invokes sh on unknown executable image types
  2011-08-25 20:46 [Bug libc/13134] New: posix_spawn() invokes sh on unknown executable image types shea at shealevy dot com
                   ` (4 preceding siblings ...)
  2011-09-06  0:38 ` shea at shealevy dot com
@ 2014-06-27 12:15 ` fweimer at redhat dot com
  2020-12-26 15:59 ` bruno at clisp dot org
  6 siblings, 0 replies; 8+ messages in thread
From: fweimer at redhat dot com @ 2014-06-27 12:15 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=13134

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/13134] posix_spawn() invokes sh on unknown executable image types
  2011-08-25 20:46 [Bug libc/13134] New: posix_spawn() invokes sh on unknown executable image types shea at shealevy dot com
                   ` (5 preceding siblings ...)
  2014-06-27 12:15 ` fweimer at redhat dot com
@ 2020-12-26 15:59 ` bruno at clisp dot org
  6 siblings, 0 replies; 8+ messages in thread
From: bruno at clisp dot org @ 2020-12-26 15:59 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=13134

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bruno at clisp dot org

--- Comment #5 from Bruno Haible <bruno at clisp dot org> ---
The change from 2011 had no effect on the Hurd.
The Hurd case has been fixed now, by Samuel Thibault:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=13adfa34aff03fd9f1c1612b537a0d736ddb6c2b

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-26 15:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-25 20:46 [Bug libc/13134] New: posix_spawn() invokes sh on unknown executable image types shea at shealevy dot com
2011-08-25 20:46 ` [Bug libc/13134] " shea at shealevy dot com
2011-08-26  6:13 ` bugdal at aerifal dot cx
2011-08-26  8:36 ` shea at shealevy dot com
2011-09-06  0:27 ` drepper.fsp at gmail dot com
2011-09-06  0:38 ` shea at shealevy dot com
2014-06-27 12:15 ` fweimer at redhat dot com
2020-12-26 15:59 ` bruno at clisp dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).