The NetBSD Project

CVS log for src/sys/sys/pax.h

[BACK] Up to [cvs.NetBSD.org] / src / sys / sys

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.29 / (download) - annotate - [select for diffs], Wed Nov 22 12:15:09 2023 UTC (4 months, 2 weeks ago) by martin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

PAGE_SIZE will not evaluate to a vaddr_t expression on all architectures
(e.g. sparc), so cast it to that.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Nov 21 14:35:36 2023 UTC (4 months, 3 weeks ago) by riastradh
Branch: MAIN
Changes since 1.27: +82 -34 lines
Diff to previous 1.27 (colored)

pax(9): Rework header file more coherently to nix some needless #ifs.

Cleans up some of the fallout from PR kern/57711 fixes.

Could do a little more to nix PAX_SEGVGUARD conditionals but maybe
not worth it.

Revision 1.26.10.1 / (download) - annotate - [select for diffs], Wed Apr 8 14:09:03 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.26: +3 -1 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

Merge changes from current as of 20200406

Revision 1.26.16.1 / (download) - annotate - [select for diffs], Sat Jan 25 22:38:53 2020 UTC (4 years, 2 months ago) by ad
Branch: ad-namecache
Changes since 1.26: +3 -1 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

Sync with head.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Jan 23 10:21:14 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, thorpej-altq-separation-base, thorpej-altq-separation, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, bouyer-sunxi-drm-base, bouyer-sunxi-drm, ad-namecache-base3, ad-namecache-base2
Changes since 1.26: +3 -1 lines
Diff to previous 1.26 (colored)

PAX_SEGVGUARD doesn't seem to work properly in testing for me, but at least
make it not cause problems:

- Cover it with exec_lock so the updates are not racy.
- Using fileassoc is silly.  Just hang a pointer off the vnode.

Revision 1.11.54.1 / (download) - annotate - [select for diffs], Sun Dec 3 11:39:20 2017 UTC (6 years, 4 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.11: +63 -8 lines
Diff to previous 1.11 (colored) next main 1.12 (colored)

update from HEAD

Revision 1.11.74.6 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:16 2017 UTC (6 years, 7 months ago) by skrll
Branch: nick-nhusb
Changes since 1.11.74.5: +20 -9 lines
Diff to previous 1.11.74.5 (colored) to branchpoint 1.11 (colored) next main 1.12 (colored)

Sync with HEAD

Revision 1.25.6.1 / (download) - annotate - [select for diffs], Thu May 11 02:58:41 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: prg-localcount2
Changes since 1.25: +20 -9 lines
Diff to previous 1.25 (colored) next main 1.26 (colored)

Sync with HEAD

Revision 1.26 / (download) - annotate - [select for diffs], Sat May 6 21:34:52 2017 UTC (6 years, 11 months ago) by joerg
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, prg-localcount2-base3, prg-localcount2-base2, phil-wifi-base, phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, isaki-audio2-base, isaki-audio2, ad-namecache-base1, ad-namecache-base
Branch point for: phil-wifi, ad-namecache
Changes since 1.25: +20 -9 lines
Diff to previous 1.25 (colored)

Extend the mmap(2) interface to allow requesting protections for later
use with mprotect(2), but without enabling them immediately.

Extend the mremap(2) interface to allow duplicating mappings, i.e.
create a second range of virtual addresses references the same physical
pages. Duplicated mappings can have different effective protections.

Adjust PAX mprotect logic to disallow effective protections of W&X, but
allow one mapping W and another X protections. This obsoletes using
temporary files for purposes like JIT.

Adjust PAX logic for mmap(2) and mprotect(2) to fail if W&X is requested
and not silently drop the X protection.

Improve test cases to ensure correct operation of the changed
interfaces.

Revision 1.11.74.5 / (download) - annotate - [select for diffs], Wed Oct 5 20:56:11 2016 UTC (7 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.11.74.4: +2 -2 lines
Diff to previous 1.11.74.4 (colored) to branchpoint 1.11 (colored)

Sync with HEAD

Revision 1.25 / (download) - annotate - [select for diffs], Sat Sep 3 12:20:58 2016 UTC (7 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: prg-localcount2
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

vsize_t is not always u_long :-)

Revision 1.11.74.4 / (download) - annotate - [select for diffs], Sun May 29 08:44:40 2016 UTC (7 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.11.74.3: +24 -3 lines
Diff to previous 1.11.74.3 (colored) to branchpoint 1.11 (colored)

Sync with HEAD

Revision 1.24 / (download) - annotate - [select for diffs], Wed May 25 20:07:54 2016 UTC (7 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, nick-nhusb-base-20160907, nick-nhusb-base-20160529
Changes since 1.23: +4 -1 lines
Diff to previous 1.23 (colored)

Give 0,1,2 for security.pax.mprotect.ptrace and make it default to 1
as documented in sysctl(7):
0 - ptrace does not affect mprotect
1 - (default) mprotect is disabled for processes that start executing from
    the debugger (being traced)
2 - mprotect restrictions are relaxed for traced processes

Revision 1.23 / (download) - annotate - [select for diffs], Wed May 25 17:43:58 2016 UTC (7 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.22: +3 -1 lines
Diff to previous 1.22 (colored)

Introduce security.pax.mprotect.ptrace sysctl which can be used to bypass
mprotect settings so that debuggers can write to the text segment of traced
processes so that they can insert breakpoints. Turned off by default.
Ok: chuq (for now)

Revision 1.22 / (download) - annotate - [select for diffs], Wed May 25 17:25:32 2016 UTC (7 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.21: +3 -1 lines
Diff to previous 1.21 (colored)

randomize the location of the rtld.

Revision 1.21 / (download) - annotate - [select for diffs], Sun May 22 14:26:10 2016 UTC (7 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.20: +15 -3 lines
Diff to previous 1.20 (colored)

reduce #ifdef mess caused by PaX

Revision 1.20 / (download) - annotate - [select for diffs], Sun May 8 01:28:09 2016 UTC (7 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.19: +3 -1 lines
Diff to previous 1.19 (colored)

Move all the randomization inside kern_pax.c so we can control it directly.
Add debugging flags to be able to set the random number externally.

Revision 1.11.74.3 / (download) - annotate - [select for diffs], Fri Apr 22 15:44:19 2016 UTC (7 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.11.74.2: +21 -3 lines
Diff to previous 1.11.74.2 (colored) to branchpoint 1.11 (colored)

Sync with HEAD

Revision 1.19 / (download) - annotate - [select for diffs], Thu Apr 7 03:31:12 2016 UTC (8 years ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20160422
Changes since 1.18: +17 -2 lines
Diff to previous 1.18 (colored)

Add PAX_MPROTECT_DEBUG

Revision 1.18 / (download) - annotate - [select for diffs], Sun Mar 20 14:58:11 2016 UTC (8 years ago) by khorben
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Let PaX ASLR know about the current emulation

This effectively fixes PaX ASLR with 32-bits emulation on 64-bits
platforms. Without this knowledge, the offset applied for 32-bits
programs was really meant for a 64-bits address space - thus
shifting the address up to 12 bits, with a success rate of about
1/4096. This offset is calculated once in the lifetime of the
process, which therefore behaved normally when able to start.

Fixes kern/50469, probably also kern/50986

Tested on NetBSD/amd64 (emul_netbsd32)

Revision 1.17 / (download) - annotate - [select for diffs], Sat Mar 19 18:56:37 2016 UTC (8 years ago) by christos
Branch: MAIN
Changes since 1.16: +4 -1 lines
Diff to previous 1.16 (colored)

Allow enabling and disabling PaX ASLR debug

Revision 1.11.74.2 / (download) - annotate - [select for diffs], Sun Dec 27 12:10:18 2015 UTC (8 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.11.74.1: +5 -3 lines
Diff to previous 1.11.74.1 (colored) to branchpoint 1.11 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.16 / (download) - annotate - [select for diffs], Sat Sep 26 16:12:24 2015 UTC (8 years, 6 months ago) by maxv
Branch: MAIN
CVS Tags: nick-nhusb-base-20160319, nick-nhusb-base-20151226
Changes since 1.15: +5 -3 lines
Diff to previous 1.15 (colored)

Revamp the way processes are PaX'ed in the kernel. Sent on tech-kern@ two
months ago, but no one reviewed it - probably because it's not a trivial
change.

This change fixes the following bug: when loading a PaX'ed binary, the
kernel updates the PaX flag of the calling process before it makes sure
the new process is actually launched. If the kernel fails to launch the
new process, it does not restore the PaX flag of the calling process,
leaving it in an inconsistent state.

Actually, simply restoring it would be horrible as well, since in the
meantime another thread may have used the flag.

The solution is therefore: modify all the functions used by PaX so that
they take as argument the exec package instead of the lwp, and set the PaX
flag in the process *right before* launching the new process - it cannot
fail in the meantime.

Revision 1.11.74.1 / (download) - annotate - [select for diffs], Tue Sep 22 12:06:17 2015 UTC (8 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.11: +9 -6 lines
Diff to previous 1.11 (colored)

Sync with HEAD

Revision 1.15 / (download) - annotate - [select for diffs], Sat Aug 15 10:24:29 2015 UTC (8 years, 7 months ago) by maxv
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921
Changes since 1.14: +1 -3 lines
Diff to previous 1.14 (colored)

Remove pax_adjust() (does not exist).

Revision 1.14 / (download) - annotate - [select for diffs], Tue Aug 4 18:28:10 2015 UTC (8 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.13: +6 -6 lines
Diff to previous 1.13 (colored)

Some changes, to reduce a bit my tech-kern@ patch:
 - move the P_PAX_ flags out of #ifdef PAX_ASLR in pax.h
 - add a generic pax_flags_active() function
 - fix a comment in exec_elf.c; interp is not static
 - KNF for return
 - rename pax_aslr() to pax_aslr_mmap()
 - rename pax_segvguard_cb() to pax_segvguard_cleanup_cb()

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jul 31 07:37:17 2015 UTC (8 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

Small changes:
 - rename pax_aslr_init() to pax_aslr_init_vm()
 - remove the PAX_ flags (unused)
 - fix a comment in pax.h

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jul 30 15:28:18 2015 UTC (8 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.11: +6 -1 lines
Diff to previous 1.11 (colored)

Revamp PaX:
 - don't confuse between ELF flags and proc flags. Introduce the proc-
   specific P_PAX_ASLR, P_PAX_MPROTECT and P_PAX_GUARD flags.
 - introduce pax_setup_elf_flags(), which takes as argument the PaX flag
   of the ELF PaX note section, and which sets the proc flag as
   appropriate. Also introduce a couple of other functions used for that
   purpose.
 - modify pax_aslr_active(), and all the other similar pieces of code, so
   that it checks the proc flag directly, without extra ELF computation

In addition to making PaX clearer, the combination of these changes fixes
the following bug: if a non-PaX'ed process is launched, and then someone
sets security.pax.{aslr,mprotect,segvguard}.global=1, the process becomes
PaX'ed while its address space hasn't been randomized, which is not likely
to be a good idea.

Now, only the proc flag is checked at runtime, which means the process's
PaX status won't be altered during the execution.

Also:
 - declare PAX_DPRINTF, makes it more readable
 - fix a typo in exec_elf.h

Revision 1.9.14.1 / (download) - annotate - [select for diffs], Mon Feb 18 21:07:23 2008 UTC (16 years, 1 month ago) by mjf
Branch: mjf-devfs
Changes since 1.9: +21 -5 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

Sync with HEAD.

Revision 1.2.10.6 / (download) - annotate - [select for diffs], Mon Jan 21 09:47:55 2008 UTC (16 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2.10.5: +21 -5 lines
Diff to previous 1.2.10.5 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

sync with head

Revision 1.9.8.1 / (download) - annotate - [select for diffs], Wed Jan 9 01:58:14 2008 UTC (16 years, 3 months ago) by matt
Branch: matt-armv6
Changes since 1.9: +21 -5 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

sync with HEAD

Revision 1.9.20.1 / (download) - annotate - [select for diffs], Wed Jan 2 21:58:05 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.9: +21 -5 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

Sync with HEAD

Revision 1.11 / (download) - annotate - [select for diffs], Thu Dec 27 15:21:53 2007 UTC (16 years, 3 months ago) by elad
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, yamt-nfs-mp-base9, yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, yamt-nfs-mp-base2, yamt-nfs-mp-base11, yamt-nfs-mp-base10, yamt-nfs-mp-base, yamt-nfs-mp, yamt-lazymbuf-base15, yamt-lazymbuf-base14, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, uebayasi-xip-base7, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, uebayasi-xip, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, rmind-uvmplock-nbase, rmind-uvmplock-base, rmind-uvmplock, rmind-smpnet-nbase, rmind-smpnet-base, rmind-smpnet, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, nick-net80211-sync-base, nick-net80211-sync, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, nick-hppapmap, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, mjf-devfs2, mjf-devfs-base, matt-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-premerge-20101231, matt-mips64-base2, matt-armv6-nbase, matt-armv6-base, khorben-n900, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, jymxensuspend-base, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, jruoho-x86intr-base, jruoho-x86intr, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3, hpcarm-cleanup-nbase, hpcarm-cleanup-base, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, haad-dm, cherry-xenmp-base, cherry-xenmp, bouyer-xeni386-nbase, bouyer-xeni386-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver, ad-socklock-base1, ad-audiomp2-base, ad-audiomp2
Branch point for: tls-maxphys, nick-nhusb
Changes since 1.10: +10 -1 lines
Diff to previous 1.10 (colored)

PAX_ASLR_DELTA_PROG_LEN -> PAX_ASLR_DELTA_EXEC_LEN, and put it in pax.h.
Export randomized bits # for stack and exec base too via sysctl.

okay christos@.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Dec 26 22:11:52 2007 UTC (16 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.9: +12 -5 lines
Diff to previous 1.9 (colored)

Add PaX ASLR (Address Space Layout Randomization) [from elad and myself]

For regular (non PIE) executables randomization is enabled for:
    1. The data segment
    2. The stack

For PIE executables(*) randomization is enabled for:
    1. The program itself
    2. All shared libraries
    3. The data segment
    4. The stack

(*) To generate a PIE executable:
    - compile everything with -fPIC
    - link with -shared-libgcc -Wl,-pie

This feature is experimental, and might change. To use selectively add
    options PAX_ASLR=0
in your kernel.

Currently we are using 12 bits for the stack, program, and data segment and
16 or 24 bits for mmap, depending on __LP64__.

Revision 1.2.10.5 / (download) - annotate - [select for diffs], Mon Sep 3 14:46:31 2007 UTC (16 years, 7 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2.10.4: +2 -2 lines
Diff to previous 1.2.10.4 (colored) to branchpoint 1.2 (colored)

sync with head.

Revision 1.5.4.1 / (download) - annotate - [select for diffs], Mon Sep 3 07:05:17 2007 UTC (16 years, 7 months ago) by wrstuden
Branch: wrstuden-fixsa
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored) next main 1.6 (colored)

Sync w/ NetBSD-4-RC_1

Revision 1.8.4.1 / (download) - annotate - [select for diffs], Sun Jul 15 13:28:11 2007 UTC (16 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

Sync with head.

Revision 1.8.6.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:12:33 2007 UTC (16 years, 9 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

Sync with head.

Revision 1.5.2.1 / (download) - annotate - [select for diffs], Mon Jul 9 10:30:55 2007 UTC (16 years, 9 months ago) by liamjfoy
Branch: netbsd-4
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, matt-nb4-arm-base, matt-nb4-arm
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored) next main 1.6 (colored)

Pull up following revision(s) (requested by christos in ticket #755):
	sys/sys/pax.h: revision 1.9
	sys/sys/exec_elf.h: revision 1.90
	usr.sbin/paxctl/paxctl.c: revision 1.2
	sys/kern/kern_pax.c: revision 1.16
	sys/sys/exec.h: revision 1.117
	sys/kern/exec_elf32.c: revision 1.124
	libexec/ld.elf_so/sysident.h: revision 1.14
Use an elf note to handle pax arguments. This is a temporary solution to
avoid wasting OS flag bits. In the future we'll probably use fileassoc to
achieve this (once there is a way to make fileassoc persistent) or in the
shorter term libelf, so that we can add and remove the note on demand instead
of burning bits on each binary. Of course since this is a tool, this means
that we'll need to think about how to handle libelf...

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jun 24 20:35:37 2007 UTC (16 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, vmlocking-base, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, jmcneill-pm-base, jmcneill-pm, jmcneill-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: mjf-devfs, matt-armv6, bouyer-xeni386
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Use an elf note to handle pax arguments. This is a temporary solution to
avoid wasting OS flag bits. In the future we'll probably use fileassoc to
achieve this (once there is a way to make fileassoc persistent) or in the
shorter term libelf, so that we can add and remove the note on demand instead
of burning bits on each binary. Of course since this is a tool, this means
that we'll need to think about how to handle libelf...

Revision 1.7.2.1 / (download) - annotate - [select for diffs], Tue Feb 27 16:55:16 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored) next main 1.8 (colored)

- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.2.10.4 / (download) - annotate - [select for diffs], Mon Feb 26 09:12:13 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2.10.3: +3 -6 lines
Diff to previous 1.2.10.3 (colored) to branchpoint 1.2 (colored)

sync with head.

Revision 1.8 / (download) - annotate - [select for diffs], Wed Feb 21 23:00:10 2007 UTC (17 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup, ad-audiomp-base, ad-audiomp
Branch point for: vmlocking, mjf-ufs-trans
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.

Revision 1.2.14.2 / (download) - annotate - [select for diffs], Fri Jan 12 01:04:24 2007 UTC (17 years, 3 months ago) by ad
Branch: newlock2
Changes since 1.2.14.1: +7 -6 lines
Diff to previous 1.2.14.1 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

Sync with head.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Jan 9 12:49:37 2007 UTC (17 years, 3 months ago) by elad
Branch: MAIN
CVS Tags: post-newlock2-merge, newlock2-nbase, newlock2-base
Branch point for: yamt-idlelwp
Changes since 1.6: +2 -5 lines
Diff to previous 1.6 (colored)

Remove advertising clause from all of my stuff.

Revision 1.2.10.3 / (download) - annotate - [select for diffs], Sat Dec 30 20:50:55 2006 UTC (17 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2.10.2: +10 -2 lines
Diff to previous 1.2.10.2 (colored) to branchpoint 1.2 (colored)

sync with head.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Dec 23 08:35:43 2006 UTC (17 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.5: +1 -2 lines
Diff to previous 1.5 (colored)

- remove the fileassoc "tabledata" functionality.  use mountspecific instead.
- make pax_segvguard_cb static.

tested and ok'ed by elad.

Revision 1.2.18.2 / (download) - annotate - [select for diffs], Sun Dec 10 07:19:28 2006 UTC (17 years, 4 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.2.18.1: +7 -2 lines
Diff to previous 1.2.18.1 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

sync with head.

Revision 1.5 / (download) - annotate - [select for diffs], Wed Nov 22 02:02:51 2006 UTC (17 years, 4 months ago) by elad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, netbsd-4-base
Branch point for: wrstuden-fixsa, netbsd-4
Changes since 1.4: +3 -0 lines
Diff to previous 1.4 (colored)

Initial implementation of PaX Segvguard (this is still work-in-progress,
it's just to get it out of my local tree).

Revision 1.4 / (download) - annotate - [select for diffs], Wed Nov 22 00:41:38 2006 UTC (17 years, 4 months ago) by elad
Branch: MAIN
Changes since 1.3: +4 -2 lines
Diff to previous 1.3 (colored)

Make PaX MPROTECT use specificdata(9), freeing up two P_* flags.
While here, make more generic for upcoming PaX features.

Revision 1.2.14.1 / (download) - annotate - [select for diffs], Sat Nov 18 21:39:47 2006 UTC (17 years, 4 months ago) by ad
Branch: newlock2
Changes since 1.2: +5 -1 lines
Diff to previous 1.2 (colored)

Sync with head.

Revision 1.2.18.1 / (download) - annotate - [select for diffs], Sun Oct 22 06:07:47 2006 UTC (17 years, 5 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.2: +5 -1 lines
Diff to previous 1.2 (colored)

sync with head

Revision 1.3 / (download) - annotate - [select for diffs], Thu Oct 12 09:28:05 2006 UTC (17 years, 6 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.2: +5 -1 lines
Diff to previous 1.2 (colored)

- include uvm_extern.h for vm_prot_t.
- add a forward decl of struct lwp.

Revision 1.2.16.2 / (download) - annotate - [select for diffs], Sat Sep 9 02:59:42 2006 UTC (17 years, 7 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.2.16.1: +40 -0 lines
Diff to previous 1.2.16.1 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

sync with head

Revision 1.2.10.2 / (download) - annotate - [select for diffs], Wed Jun 21 15:12:03 2006 UTC (17 years, 9 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2.10.1: +40 -0 lines
Diff to previous 1.2.10.1 (colored) to branchpoint 1.2 (colored)

sync with head.

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Mon Jun 19 04:11:13 2006 UTC (17 years, 9 months ago) by chap
Branch: chap-midi
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored) next main 1.2 (colored)

Sync with head.

Revision 1.2.6.2 / (download) - annotate - [select for diffs], Thu Jun 1 22:39:26 2006 UTC (17 years, 10 months ago) by kardel
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.2.6.1: +40 -0 lines
Diff to previous 1.2.6.1 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

Sync with head.

Revision 1.2.4.2 / (download) - annotate - [select for diffs], Wed May 24 15:50:47 2006 UTC (17 years, 10 months ago) by tron
Branch: peter-altq
Changes since 1.2.4.1: +40 -0 lines
Diff to previous 1.2.4.1 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.2.2.2 / (download) - annotate - [select for diffs], Wed May 24 10:59:21 2006 UTC (17 years, 10 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.2.2.1: +40 -0 lines
Diff to previous 1.2.2.1 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

sync with head.

Revision 1.2.16.1, Sat May 20 15:45:38 2006 UTC (17 years, 10 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.2: +0 -40 lines
FILE REMOVED

file pax.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:59:42 +0000

Revision 1.2.10.1, Sat May 20 15:45:38 2006 UTC (17 years, 10 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.2: +0 -40 lines
FILE REMOVED

file pax.h was added on branch yamt-lazymbuf on 2006-06-21 15:12:03 +0000

Revision 1.2.6.1, Sat May 20 15:45:38 2006 UTC (17 years, 10 months ago) by kardel
Branch: simonb-timecounters
Changes since 1.2: +0 -40 lines
FILE REMOVED

file pax.h was added on branch simonb-timecounters on 2006-06-01 22:39:26 +0000

Revision 1.2.4.1, Sat May 20 15:45:38 2006 UTC (17 years, 10 months ago) by tron
Branch: peter-altq
Changes since 1.2: +0 -40 lines
FILE REMOVED

file pax.h was added on branch peter-altq on 2006-05-24 15:50:47 +0000

Revision 1.2.2.1, Sat May 20 15:45:38 2006 UTC (17 years, 10 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.2: +0 -40 lines
FILE REMOVED

file pax.h was added on branch yamt-pdpolicy on 2006-05-24 10:59:21 +0000

Revision 1.2 / (download) - annotate - [select for diffs], Sat May 20 15:45:38 2006 UTC (17 years, 10 months ago) by elad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, rpaulo-netinet-merge-pcb-base, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-splraiseipl, yamt-pdpolicy, yamt-lazymbuf, simonb-timecounters, rpaulo-netinet-merge-pcb, peter-altq, newlock2
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

Better implementation of PaX MPROTECT, after looking some more into the
code and not trying to use temporary solutions.

Lots of comments and help from YAMAMOTO Takashi, also thanks to the PaX
author for being quick to recognize that something fishy's going on. :)

Hook up in mmap/vmcmd rather than (ugh!) uvm_map_protect().

Next time I suggest to commit a temporary solution just revoke my
commit bit.

Revision 1.1 / (download) - annotate - [select for diffs], Tue May 16 00:08:25 2006 UTC (17 years, 11 months ago) by elad
Branch: MAIN
Branch point for: chap-midi

Introduce PaX MPROTECT -- mprotect(2) restrictions used to strengthen
W^X mappings.

Disabled by default.

First proposed in:

	http://mail-index.netbsd.org/tech-security/2005/12/18/0000.html

More information in:

	http://pax.grsecurity.net/docs/mprotect.txt

Read relevant parts of options(4) and sysctl(3) before using!

Lots of thanks to the PaX author and Matt Thomas.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>