git: ed52452d6e52 - MFC r368772: Add ELF flag to disable ASLR stack gap.

Konstantin Belousov kostikbel at gmail.com
Sat Dec 26 00:19:39 UTC 2020


On Fri, Dec 25, 2020 at 06:04:27PM -0600, Brandon Bergren wrote:
> Build broken on stable-12 i386 (detected by my local CI where I'm testing git CI):
> 
> 17:26:24 --- kern_exec.o ---
> 17:26:24 /usr/src/sys/kern/kern_exec.c:1508:34: error: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned int *') to parameter of type 'u_long *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]
> 17:26:24         imgp->sysent->sv_stackgap(imgp, dp);
> 17:26:24                                         ^~

Thanks.
Can you confirm that the following change is enough ?

commit 77419219289fe0817fae255b48db69718d91f816
Author: Konstantin Belousov <kib at FreeBSD.org>
Date:   Sat Dec 26 02:16:29 2020 +0200

    Cast sv_stackgap argument
    
    to minimally intrusively handle difference between 12 and HEAD.
    On all supported architectures representation of longs and pointers
    is same.
    
    Reported by:    bdragon

diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 812d5e82709..64c9e84db07 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1505,7 +1505,7 @@ exec_stackgap(struct image_params *imgp, uintptr_t *dp)
 	    NT_FREEBSD_FCTL_ASG_DISABLE)) != 0 ||
 	    (imgp->map_flags & MAP_ASLR) == 0)
 		return;
-	imgp->sysent->sv_stackgap(imgp, dp);
+	imgp->sysent->sv_stackgap(imgp, (u_long *)dp);
 }
 
 /*


More information about the dev-commits-src-all mailing list