Commit Graph

29 Commits

Author SHA1 Message Date
bdrewery
b619f0c747 Revert r267233 for now. PIE support needs to be reworked.
1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
   build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
   where it never would work anyhow, such as csu or loader. This suggests
   there may be better ways of adding support to the tree. Many of these
   cases can be fixed such that -fPIE will work but there is really no
   reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
   really building libraries but have been using bsd.prog.mk because the code
   is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
   been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by:	kib
2014-08-19 15:04:32 +00:00
bdrewery
989e2c6000 In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.
This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by:		Shawn Webb <lattera@gmail.com>
Discussed between:	des@ and Shawn Webb [2]
2014-06-08 17:29:31 +00:00
imp
c39e6fc2c9 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.
2014-04-13 05:21:56 +00:00
ed
120125784a Add the Clang specific -Wmissing-variable-declarations to WARNS=6.
This compiler flag enforces that that people either mark variables
static or use an external declarations for the variable, similar to how
-Wmissing-prototypes works for functions.

Due to the fact that Yacc/Lex generate code that cannot trivially be
changed to not warn because of this (lots of yy* variables), add a
NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this
specific compiler warning.

Announced on:	toolchain@
2013-04-19 19:45:00 +00:00
pluknet
61a0c16893 mdoc: point to an existing cross reference. 2012-10-02 09:53:50 +00:00
bapt
310ab6d7ff Fix world after byacc import:
- old yacc(1) use to magicially append stdlib.h, while new one don't
- new yacc(1) do declare yyparse by itself, fix redundant declaration of
  'yyparse'

Approved by:	des (mentor)
2012-05-22 16:33:10 +00:00
phk
a3f6bc2c11 Another couple of unsigned/ssize_t changes. 2011-03-01 08:52:10 +00:00
phk
acdeb0f1a2 Type-change to ssize_t to (app|pl)ease ppc platform. 2011-02-28 14:48:00 +00:00
phk
851c06bea5 Update fifolog internals to match main version:
Rename ...write_bytes... to ...write_records..., that's what they do.

Move writer .h stuff into writer private .h file.

Change logic in writer to support both fifolog usage in FreeBSD and
Measured usage better, by always using an input buffer.

Various cleanups.
2011-02-28 09:11:46 +00:00
phk
91a0b8165f Don't override the perfectly good default ->zalloc and ->zfree functions. 2011-02-28 08:59:35 +00:00
phk
86423932a6 Fix a bunch of trivial whitespace mistakes and update the miniobj.h
file before the real work starts.
2011-02-25 09:40:17 +00:00
phk
bda3b883cd Use a "push" strategy to get data through libz, rather than a "pull" strategy. 2010-12-07 16:30:52 +00:00
uqs
dbd065ca6c Typo fixes
PR:		docs/149314
Submitted by:	olgeni
MFC after:	3 days
2010-08-06 12:38:30 +00:00
keramida
18ad9f5070 Fix reading of empty fifolog files. When we don't have anything
to inflate, skip the rest of the fifolog reader code to avoid
hitting the assert about Z_OK a bit further down.

Approved by:	phk
MFC after:	1 week
2010-07-10 11:40:31 +00:00
phk
0d79835fcf Do not attempt to render a logrecord with length byte, until we have
decompressed all the bytes required.
2010-05-15 08:57:16 +00:00
uqs
3960614646 mdoc: order prologue macros consistently by Dd/Dt/Os
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 19:08:06 +00:00
ed
073cafdd42 The last big commit: let usr.sbin/ use WARNS=6 by default. 2010-01-02 11:07:44 +00:00
ed
b9ca89bfc4 ANSIfy almost all applications that use WARNS=6.
I was considering committing all these patches one by one, but as
discussed with brooks@, there is no need to do this. If we ever
need/want to merge these changes back, it is still possible to do this
per application.
2009-12-29 22:53:27 +00:00
jh
3357d5a40a Unify fifolog_writer usage printout with fifolog_create and
fifolog_reader.

Approved by:	trasz (mentor)
2009-11-17 17:38:41 +00:00
ru
f2d082b711 Fixed NAME section. 2009-04-04 15:48:09 +00:00
phk
041c968b4f The last sector in the first segment might just be a sync, increment before
checking validity of segment two.
2009-02-02 14:30:07 +00:00
phk
8b7a45678f Don't overwrite it, if only one sector is written yet.
Discovered by:	"Dewayne Geraghty" <dewayne.geraghty@heuristicsystems.com.au>
2009-02-02 14:29:15 +00:00
phk
a4110620aa Fix a cornercase during search 2008-12-09 09:25:03 +00:00
phk
b6c607e98b Populate usage()
Submitted by:   Jaakko Heinonen <jh@saunalahti.fi>
2008-05-14 23:29:02 +00:00
ru
446475df44 Clean up makefiles and a manpage.
OK'ed by:	phk
2008-04-10 14:02:00 +00:00
phk
a940156e22 Accept empty -T arguments.
Proposed by:	clemens fischer <ino-qc@spotteswoode.de.eu.org>
2008-03-31 13:56:15 +00:00
phk
394021fd91 Fix two bugs introduced in conversion to FreeBSD source tree:
Off by one error in length calcuation of string records.
Don't attempt to free stack variable.
2008-03-19 10:56:51 +00:00
phk
d44989c323 Remove trailing ';' on macros.
Spotted by:	antoine
2008-03-16 23:00:43 +00:00
phk
329dcba2df Add the fifolog tools to FreeBSD.
Quoth the man-page:

     Fifologs provide a compact round-robin circular storage for recording
     text and binary information to permanent storage in a bounded and pre-
     dictable fashion, time and space wise.

Not yet connected to the build, but feel free to test & review.
2008-03-09 19:14:36 +00:00