Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Dec 2020 02:19:24 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Brandon Bergren <bdragon@imap.cc>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org
Subject:   Re: git: ed52452d6e52 - MFC r368772: Add ELF flag to disable ASLR stack gap.
Message-ID:  <X%2BaBjObzRmT2wFnh@kib.kiev.ua>
In-Reply-To: <0daef1d3-4b70-430e-acfe-5c881a53341c@www.fastmail.com>
References:  <202012251347.0BPDlc8U082236@gitrepo.freebsd.org> <0daef1d3-4b70-430e-acfe-5c881a53341c@www.fastmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?X%2BaBjObzRmT2wFnh>