Committed: Do not make non-regular files executable.

Nick Clifton nickc@redhat.com
Thu Jun 11 15:18:00 GMT 2009


Hi Guys,

  I am applying the attached patch which is based on a bug report
  submitted to the Fedora bugzilla database (BZ 503426).  The problem
  was that the linker would attempt to add execute permission to a
  non-regular file if was given that file as an output.  This does not
  make a lot of sense and can trigger an exception in a secure
  system.  (The particular scenario where this happens was part of
  the kernel build process on an SELinux system where the linker was
  being invoked as "ld [...] -o /dev/null".

  Tested by building and regression checking all the usual toolchains.

Cheers
  Nick

bfd/ChangeLog
2009-06-11  Eric Paris  <eparis@redhat.com>
	    Nick Clifton  <nickc@redhat.com>

	* opncls.c (_maybe_make_executable): New function.  Gives execute
	permission to an executable bfd that was opened for writing
	provided that it is a regular file.  Replaces common code found in...
	(bfd_close): here and ...
	(bfd_close_all_done): here.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: opncls.c.patch
Type: text/x-patch
Size: 2527 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20090611/beafc771/attachment.bin>


More information about the Binutils mailing list