Bug 230156 - shells/dash: Update to 0.5.10.2
Summary: shells/dash: Update to 0.5.10.2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords: patch-ready
Depends on:
Blocks:
 
Reported: 2018-07-29 18:22 UTC by Nathan
Modified: 2018-09-13 20:59 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (bdrewery)


Attachments
Update (1.22 KB, patch)
2018-07-29 18:22 UTC, Nathan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan 2018-07-29 18:22:33 UTC
Created attachment 195601 [details]
Update

Tried finding the Release Notes, but failed.

Removed the lines for i386 cflags. Used qemu to test if it works in 11.2-Stable-i386. Built fine and ran ls, echo, cat and didn't run into any errors
Comment 1 Bryan Drewery freebsd_committer 2018-09-13 20:54:53 UTC
Actually the CFLAGS is a symptom but not exactly limited to i386.
NSIG is defined as 32 in /usr/include/sys/signal.h.
In dash it creates an array 2 times the size of NSIG:
    char *signal_names[2 * NSIG + 3];
But later it tries to reference index SIGRTMAX (defined as 126) in
work/dash-0.5.10.2/src/mksignames.c:
    #if defined (SIGRTMAX)
      rtmax = SIGRTMAX;
      signal_names[rtmax] = "RTMAX";
    #endif
So this is causing an out-of-bounds write. It would be a problem
on amd64 and i386. It probably only manifested as a *crash* on i386
though.
Redefining NSIG to be larger would fix the problem but I'm going to
just keep UNUSABLE_RT_SIGNALS defined for now to not enable the RT
signal handling.
Comment 2 commit-hook freebsd_committer 2018-09-13 20:59:01 UTC
A commit references this bug:

Author: bdrewery
Date: Thu Sep 13 20:58:57 UTC 2018
New revision: 479695
URL: https://svnweb.freebsd.org/changeset/ports/479695

Log:
  - Update to 0.5.10.2 [1]
  - Update comment on the real problem with UNUSABLE_RT_SIGNALS.  This is
    avoiding a buffer overflow due to NSIG*2 being far smaller than
    SIGRTMAX.

  PR:		230156 [1]
  Submitted by:	Nathan <ndowens@yahoo.com> (based on) [1]

Changes:
  head/shells/dash/Makefile
  head/shells/dash/distinfo