1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
Commit Graph

53 Commits

Author SHA1 Message Date
deraadt
fd5846a355 New accounting flag ABTCFI to indicate signal SIGILL + code ILL_BTCFI
has occurred in the process.
ok various people
2024-02-25 00:07:13 +00:00
deraadt
f4577f1a84 pinsyscall(SYS_execve) will soon go away, so the sys/acct.h bit AEXECVE
can also be remove.  Delete the code using it from the one program that
inspects it.
2024-01-19 14:25:03 +00:00
deraadt
088ad7e529 Report system call pinning violations. 2023-12-11 00:40:31 +00:00
deraadt
0a857551e1 for process kills due to execve from non-pinned syscall address, export
a new AEXECVE bit to acct(4), and print it in lastcomm(8)
ok bluhm
2023-02-21 14:31:07 +00:00
bluhm
13c74f85fd Print the pid in lastcomm(1) output for post mortem analysis. Put
it in brackets after the command name, like syslogd does it in log
files.  A while ago the process id was added to process accounting
in the kernel, so no ABI break this time.
OK deraadt@
2023-02-01 00:03:38 +00:00
cheloha
d7259957e8 userspace: remove vestigial '?' cases from top-level getopt(3) loops
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.  Hence, remove all the redundant "case '?':" lines.

Prompted by dlg@.  With help from dlg@ and millert@.

Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2

ok naddy@ millert@ dlg@
2022-12-04 23:50:45 +00:00
deraadt
5e1064a7ac acct(4) ac_tty shouldn't need NODEV from sys/param.h (which is kernel API),
-1 is sufficient to indicate the process had no controlling tty, removing
one more sys/param.h include in our userland
ok millert
2021-12-13 16:37:37 +00:00
bluhm
dd06cfbcff Inform about system call memory write protection and stack mapping
violations in system accounting.  This will help to find missbehaving
programs and possible attacks.  The flags bit field is full, so
recycle the PDP-11 compatibility on VAX.  lastcomm(1) prints the
AMAP flag as 'M'.  daily(8) prints a list of affected processes.
OK deraadt@
2019-09-09 20:02:26 +00:00
deraadt
d4db6826f2 No specific called "exec(3)", so move primary manpage to a name which
does exist -- execv(3).  Still call this a family but without "Nm".
Adjust Xr in various pages to refer to the precise function used
rather than the family, in most cases the semantics of execve(2) are
being referenced, so change the Xr.
ok jmc
2019-08-11 15:48:08 +00:00
millert
d89de9161f Replace cross-references to sigvec(3) with sigaction(2).
OK guenther@
2019-07-26 12:08:18 +00:00
deraadt
56025107dc convert flag listing into a .Bl 2019-07-25 19:05:22 +00:00
bluhm
227c47e95c Show unveil(2) violators in lastcomm(1) output and daily mail.
input Janne Johansson, schwarze@; OK deraadt@ millert@
2019-07-25 13:13:53 +00:00
mpi
763163dc4e Stop mentionning/testing the for the ASU bit (S flag).
It is of no use since suser() no longer set this bit.

ok millert@, bluhm@
2018-02-27 07:58:29 +00:00
bluhm
8788635fa4 ASLR, W^X, and guard pages trigger processor traps that result in
SIGILL, SIGBUS, SIGSEGV signals.  Make such memory violations visible
in lastcomm(1).  This also works if a programm tries to hide them
with a signal handler.  Manual kill -SEGV does not generate false
positives.
OK deraadt@
2017-06-08 17:14:02 +00:00
bluhm
696e057396 Add an acct(5) flag for pledge violations. Then lastcomm(1) shows
when something went wrong.  This allows to monitor whether the
system is under attack and that the attack has been prevented by
OpenBSD pledge(2).
OK deraadt@ millert@ jmc@
2017-06-07 20:53:59 +00:00
guenther
ffe261bf47 Use sizeof directly instead of a macro from the scary <struct.h>
ok visa@ mpi@ millert@ kettenis@ deraadt@
2017-03-11 18:33:21 +00:00
deraadt
0bd1216cbf Change all tame callers to namechange to pledge(2). 2015-10-09 01:37:06 +00:00
deraadt
d593eea826 tame "stdio rpath getpw". getpw is for user_from_uid(), which is a libc
cache on top of the getpw* functions.
ok semarie, who didn't spot the getpw need :)
2015-10-07 14:05:07 +00:00
millert
f7055df57d tzfile.h is an internal header that should never have been installed.
What's worse, the tzfile.h that gets installed is over 20 years old
and doesn't match the real tzfile.h in libc/time.  This makes the
tree safe for /usr/include/tzfile.h removal.  The TM_YEAR_BASE
define has been moved to time.h temporarily until its usage is
replaced by 1900 in the tree.  Actual removal of tzfile.h is pending
a ports build.  Based on a diff from deraadt@
2015-03-15 00:41:27 +00:00
deraadt
b9fc9a728f Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
2015-01-16 06:39:28 +00:00
okan
5195d91e62 remove erroneous char cast to switch expression processing getopt(3);
not used in any cases.

ok deraadt@, guenther@, millert@
2013-11-27 13:32:02 +00:00
deraadt
6cd4fad2c3 unsigned char casts for ctype
ok krw
2013-11-26 13:18:53 +00:00
deraadt
043fbe51c1 rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
2009-10-27 23:59:19 +00:00
jmc
98bec93045 oops, missed a bit from tobias' diff - add "usage: " to usage();
from Tobias Stoeckmann
2007-07-16 18:43:05 +00:00
jmc
2fd73b92c6 sync usage(); from Tobias Stoeckmann 2007-07-16 18:40:18 +00:00
jmc
9490d37cb6 convert to new .Dd format; 2007-05-31 19:19:00 +00:00
deraadt
98204de9da lint begs for proactive casting, so we give it 2004-09-14 22:54:54 +00:00
deraadt
3c2c0383ab more proto fixes 2003-06-26 21:59:10 +00:00
deraadt
1837a5ca50 mostly ansi cleanup; pval ok 2003-06-10 22:20:44 +00:00
jmc
2aeff9fb4d - section reorder
- COMPATIBILITY merge
- macro cleanup
- kill whitespace at EOL
- new sentence, new line

ssh pages ok markus@
2003-06-10 09:12:09 +00:00
millert
f75387cb26 Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.
2003-06-03 02:56:05 +00:00
espie
6d68987d51 Add missing libraries to bsd.prog.mk (mostly kerberosV)
Use them in DPADD throughout the tree.
Fix a few mispells (LIBMATH -> LIBM...)
Wipe obsolete lib (LIBRESOLV)
Sort added missing libraries, move obsolete stuff apart.
Synch documentation in bsd.README

ok deraadt@
2002-05-11 00:20:18 +00:00
millert
c72b5b24e1 Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically. 2002-02-16 21:27:05 +00:00
mpech
c0932ef1ff kill more registers
millert@ ok
2001-11-19 19:02:13 +00:00
pvalchev
b2d53501a5 -Wall cleanup 2001-07-18 17:17:39 +00:00
deraadt
c3e1e82e9b first pass at a -Wall cleanup 2001-07-12 05:16:53 +00:00
aaron
f1ba34738e Change all option list specifications to ".Bl -tag -width Ds". Most man
pages just needed their -width parameter tweaked to "Ds", which provides
a nice width of 6 constant characters. For consistency more than anything.
2000-11-09 17:51:53 +00:00
aaron
2e3943820e Various cleanups and improvements. 2000-03-08 03:11:27 +00:00
aaron
2e0eb34f9e - remove trailing white space
- remove arguments from .Os macros
- remove arguments from .Nm macros, where appropriate
- some more Dq/Sq/Ql insanity
- still lots to do in the usr.bin tree... :/
1999-06-05 01:21:16 +00:00
alex
350bb3b813 Cleanup xrefs under SEE ALSO. Specifically:
- Sort xrefs by section, and then alphabetically.
  - Add missing commas between xref items.
  - Remove commas from the last xref entry.
  - Remove duplicate entries.
1999-05-16 19:54:36 +00:00
aaron
bd2318b988 remove redundant .Pp macros 1998-11-11 23:01:42 +00:00
aaron
aea1524a59 usr.bin/ man page fixes, f-m. 1998-09-26 19:54:41 +00:00
pjanzen
ee14b928da typo 1998-07-26 11:08:24 +00:00
espie
85637cae60 Man pages Xrefs. 1998-07-24 00:43:40 +00:00
deraadt
e189ddde44 $OpenBSD$ 1997-09-21 11:34:32 +00:00
flipk
d014d16461 mm, didn't quite get it the first time.
rearrange seek/test/print logic to avoid seeking to before
beginning of file.  netbsd/PR #3634, John F. Woods <jfw@jfwhome.funhouse.com>
1997-06-02 02:39:42 +00:00
deraadt
568c18542b xref accton 1997-05-30 00:10:34 +00:00
flipk
5ac84c996e don't try to fseek to before the beginning of the file;
showed up after the fix to sys_lseek concerning negative offsets.
avoids '/var/account/acct: Invalid argument' messages.
1997-03-03 03:25:10 +00:00
millert
72799b18e5 getopt(3) returns -1 when out of args, not EOF, whee! 1997-01-15 23:40:20 +00:00
deraadt
1258a77d10 rcsid 1996-06-26 05:31:08 +00:00