Bug 234454 - ar produces corrupt .a archive when >4GB
Summary: ar produces corrupt .a archive when >4GB
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks: 233094
  Show dependency treegraph
 
Reported: 2018-12-28 01:20 UTC by Ed Maste
Modified: 2019-01-11 19:54 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2018-12-28 01:20:18 UTC
Our ar (usr.bin/ar) only supports the 32-bit symbol table format, not the 64-bit /SYM64/ format, and silently truncates symbol offsets >4GB.

At the very least we should exit with an error in this case, but we should really support /SYM64/.
Comment 1 commit-hook freebsd_committer 2018-12-28 17:00:29 UTC
A commit references this bug:

Author: emaste
Date: Fri Dec 28 17:00:13 UTC 2018
New revision: 342575
URL: https://svnweb.freebsd.org/changeset/base/342575

Log:
  ar: detect and error out on 32-bit symbol table overflow

  BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
  previously truncated to 32-bits, silently producing corrupted archives
  larger than 4GB.

  Note that this is only a partial fix; additional checks will come.

  PR:		234454
  Reported by:	Aijaz Baig, imp
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/usr.bin/ar/write.c
Comment 2 commit-hook freebsd_committer 2018-12-28 22:48:27 UTC
A commit references this bug:

Author: emaste
Date: Fri Dec 28 22:47:56 UTC 2018
New revision: 342580
URL: https://svnweb.freebsd.org/changeset/base/342580

Log:
  ar: detect and error out on 32-bit symbol table overflow

  BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
  previously truncated to 32-bits, silently producing corrupted archives
  larger than 4GB.

  This is another overflow case in addtion to r342575.

  PR:		234454
  Reported by:	Aijaz Baig, imp
  MFC after:	2 weeks
  MFC with:	r342575
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/usr.bin/ar/write.c
Comment 3 commit-hook freebsd_committer 2019-01-11 19:49:42 UTC
A commit references this bug:

Author: emaste
Date: Fri Jan 11 19:49:19 UTC 2019
New revision: 342949
URL: https://svnweb.freebsd.org/changeset/base/342949

Log:
  MFC r342575, r342580: ar: detect and error out on 32-bit symbol table overflow

  BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
  previously truncated to 32-bits, silently producing corrupted archives
  larger than 4GB.

  PR:		234454

Changes:
_U  stable/12/
  stable/12/usr.bin/ar/write.c
Comment 4 commit-hook freebsd_committer 2019-01-11 19:54:50 UTC
A commit references this bug:

Author: emaste
Date: Fri Jan 11 19:53:45 UTC 2019
New revision: 342950
URL: https://svnweb.freebsd.org/changeset/base/342950

Log:
  MFC r342575, r342580: ar: detect and error out on 32-bit symbol table overflow

  BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
  previously truncated to 32-bits, silently producing corrupted archives
  larger than 4GB.

  PR:		234454

Changes:
  stable/11/usr.bin/ar/write.c