Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Respect alignment requests of executable when PAX_A...



details:   https://anonhg.NetBSD.org/src/rev/a54715fd87cd
branches:  trunk
changeset: 985546:a54715fd87cd
user:      rin <rin%NetBSD.org@localhost>
date:      Mon Aug 30 01:25:10 2021 +0000

description:
Respect alignment requests of executable when PAX_ASLR is enabled on
kernel, but disabled for the process, as in the same manner as PAX_ASLR
is disabled; see pax_aslr_exec_offset() for !PAX_ASLR in sys/sys/pax.h.

This is a regression introduced in kern_pax.c rev 1.58:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_pax.c#rev1.58

Part of PR port-arm/56380 but unfortunately this does not fix the
problem described in the PR...

diffstat:

 sys/kern/kern_pax.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f5f83c8aa85a -r a54715fd87cd sys/kern/kern_pax.c
--- a/sys/kern/kern_pax.c       Mon Aug 30 00:26:11 2021 +0000
+++ b/sys/kern/kern_pax.c       Mon Aug 30 01:25:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_pax.c,v 1.61 2020/01/23 10:21:14 ad Exp $ */
+/*     $NetBSD: kern_pax.c,v 1.62 2021/08/30 01:25:10 rin Exp $        */
 
 /*
  * Copyright (c) 2015, 2020 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.61 2020/01/23 10:21:14 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.62 2021/08/30 01:25:10 rin Exp $");
 
 #include "opt_pax.h"
 
@@ -604,7 +604,7 @@
 #endif
        return pax_aslr_offset(align);
 out:
-       return 0;
+       return MAX(align, PAGE_SIZE);
 }
 
 voff_t



Home | Main Index | Thread Index | Old Index