* Structure to access an array of integers.
* Used to pass trace command from
* parent to child being traced.
* This data base cannot be
* Send the specified signal to
* all processes with 'tp' as its
* Called by tty.c for quits and
for(p
= &proc
[0]; p
< &proc
[NPROC
]; p
++)
* Send the specified signal to
* Returns true if the current
* process has a signal to process.
* This is asked at least once
* each time a process enters the
* A signal does not do anything
* directly to a process; it sets
* a flag that asks the process to
* do something to itself.
if((u
.u_signal
[n
]&1) == 0)
* Enter the tracing STOP state.
* In this state, the parent is
* informed and the process is able to
* receive commands from the parent.
register struct proc
*pp
, *cp
;
for (pp
= &proc
[0]; pp
< &proc
[NPROC
]; pp
++)
if (pp
->p_pid
== cp
->p_ppid
) {
if ((cp
->p_flag
&STRC
)==0 || procxmt())
* Perform the action specified by
if((p
=u
.u_signal
[n
]) != 0) {
if(n
!= SIGINS
&& n
!= SIGTRC
)
suword(n
+2, u
.u_ar0
[RPS
]);
u
.u_arg
[0] = (u
.u_ar0
[R0
]<<8) | n
;
* Create a core image on the file "core"
* If you are looking for protection glitches,
* there are probably a wealth of them here
* when this occurs to a suid command.
* It writes USIZE block of the
* user.h area followed by the entire
if(!access(ip
, IWRITE
) &&
(ip
->i_mode
&IFMT
) == 0 &&
s
= u
.u_procp
->p_size
- USIZE
;
* grow the stack to include the SP
* true return if successful.
si
= ldiv(-sp
, 64) - u
.u_ssize
+ SINCR
;
if(estabur(u
.u_tsize
, u
.u_dsize
, u
.u_ssize
+si
, u
.u_sep
))
expand(u
.u_procp
->p_size
+si
);
a
= u
.u_procp
->p_addr
+ u
.u_procp
->p_size
;
for(i
=u
.u_ssize
; i
; i
--) {
u
.u_procp
->p_flag
=| STRC
;
for (p
=proc
; p
< &proc
[NPROC
]; p
++)
&& p
->p_ppid
==u
.u_procp
->p_pid
)
ipc
.ip_data
= u
.u_ar0
[R0
];
ipc
.ip_addr
= u
.u_arg
[1] & ~01;
u
.u_ar0
[R0
] = ipc
.ip_data
;
* Code that the child process
* executes to implement the command
* of the parent process in tracing.
if (ipc
.ip_lock
!= u
.u_procp
->p_pid
)
if (fuibyte(ipc
.ip_addr
) == -1)
ipc
.ip_data
= fuiword(ipc
.ip_addr
);
if (fubyte(ipc
.ip_addr
) == -1)
ipc
.ip_data
= fuword(ipc
.ip_addr
);
if (i
<0 || i
>= (USIZE
<<6))
ipc
.ip_data
= u
.inta
[i
>>1];
/* write user I (for now, always an error) */
if (suiword(ipc
.ip_addr
, 0) < 0)
suiword(ipc
.ip_addr
, ipc
.ip_data
);
if (suword(ipc
.ip_addr
, 0) < 0)
suword(ipc
.ip_addr
, ipc
.ip_data
);
p
= &u
.inta
[ipc
.ip_addr
>>1];
if (p
>= u
.u_fsav
&& p
< &u
.u_fsav
[25])
if (p
== &u
.u_ar0
[regloc
[i
]])
if (p
== &u
.u_ar0
[RPS
]) {
ipc
.ip_data
=| 0170000; /* assure user space */
ipc
.ip_data
=& ~0340; /* priority 0 */
/* set signal and continue */
u
.u_procp
->p_sig
= ipc
.ip_data
;