The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: dot@dotat.at (Tony Finch)
Subject: [TUHS] Old Unix vulnerabilities
Date: Mon, 15 May 2017 10:46:08 +0100	[thread overview]
Message-ID: <alpine.DEB.2.11.1705151035170.2058@grey.csi.cam.ac.uk> (raw)
In-Reply-To: <1494741150.709655.975854064.7B3C6781@webmail.messagingengine.com>

Random832 <random832 at fastmail.com> wrote:
> On Sat, May 13, 2017, at 19:34, Dave Horsfall wrote:
> >
> > A beauty in V6 (and possibly V7) was discovered by the kiddies in Elec
> > Eng; by sending a signal with an appropriately-crafted negative value (as
> > determined from inspecting <user.h>) you could overwrite u.u_uid with
> > zero...  Needless to say I scrambled to fix that one on my 11/40 network!
>
> V7 fixes it by changing the if(sig >= NSIG) in psignal to cast it to
> unsigned.

Even without that check V7 wouldn't be vulnerable. In V6, the
vulnerability occurs in psig() when the signal action is reset:

http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/sys/ken/sig.c

	rp = u.u_procp;
	n = rp->p_sig;
	rp->p_sig = 0;
	if((p=u.u_signal[n]) != 0) {
		u.u_error = 0;
		if(n != SIGINS && n != SIGTRC)
			u.u_signal[n] = 0;
		/* if n < 0 this can overwrite u.u_uid */

In V7, instead of a single pending signal, there is a bitmap of pending
signals, so the corresponding code is,

http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/sys/sys/sig.c

	n = fsig(rp);
	if (n==0)
		return;
	rp->p_sig &= ~(1<<(n-1));
	if((p=u.u_signal[n]) != 0) {
		u.u_error = 0;
		if(n != SIGINS && n != SIGTRC)
			u.u_signal[n] = 0;
		/* always within the array bounds */

Tony.
-- 
f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/  -  I xn--zr8h punycode
Viking, North Utsire, South Utsire, Northeast Forties: Variable becoming
southeasterly 3 or 4, increasing 5 to 7, perhaps gale 8 later. Slight or
moderate becoming moderate or rough later. Fog patches, rain later. Moderate,
occasionally very poor.


  reply	other threads:[~2017-05-15  9:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 23:34 Dave Horsfall
2017-05-14  5:52 ` Random832
2017-05-15  9:46   ` Tony Finch [this message]
2017-05-14  6:11 ` Random832
2017-05-18 17:32 ` Tim Newsham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.11.1705151035170.2058@grey.csi.cam.ac.uk \
    --to=dot@dotat.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).