NetBSD Problem Report #50312

From kre@munnari.OZ.AU  Thu Oct  8 01:21:58 2015
Return-Path: <kre@munnari.OZ.AU>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id E0491A5864
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  8 Oct 2015 01:21:58 +0000 (UTC)
Message-Id: <201510080120.t981KTSl005724@andromeda.noi.kre.to>
Date: Thu, 8 Oct 2015 08:20:29 +0700 (ICT)
From: kre@munnari.OZ.AU
To: gnats-bugs@gnats.NetBSD.org
Subject: current kernel compile failure if PAX_ASLR is not defined
X-Send-Pr-Version: 3.95

>Number:         50312
>Category:       kern
>Synopsis:       current kernel compile failure if PAX_ASLR is not defined
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 08 01:25:00 +0000 2015
>Closed-Date:    Sat Oct 10 19:48:22 +0000 2015
>Last-Modified:  Sat Oct 10 19:48:22 +0000 2015
>Originator:     Robert Elz
>Release:        NetBSD 7.99.21  (current as of 2015-10-08)
>Organization:
	Prince of Songkla University
>Environment:
System: NetBSD andromeda.noi.kre.to 7.0_RC2 NetBSD 7.0_RC2 (VBOX64-1.1-20150727) #12: Mon Jul 27 11:21:03 ICT 2015 kre@onyx.coe.psu.ac.th:/usr/obj/7/kernels/amd64/VBOX64 amd64
Architecture: x86_64
Machine: amd64
>Description:
	If a kernel configuration file does not have the PAX_ASLR option
	in it at all, the resulting kernel fails to compile.

	The problem is in kern_pax.c ...

/release/current/src/sys/kern/kern_pax.c: In function 'pax_setup_elf_flags':
/release/current/src/sys/kern/kern_pax.c:308:5: error: dereferencing pointer to 
incomplete type
  epp->ep_pax_flags = flags;
     ^

	To make it easier to find, the line in question is the last
	meaningful line in pax_setup_elf_flags()

	epp is a struct exec_package *

	struct exec_package is defined in sys/exec.h

	kern_pax.c includes sys/exec.h only if PAX_ASLR is defined.

	Line 308 of kern_pax.c is compiled, regardless of whether
	PAX_ASLR is defined or not.    If not there's no definition
	visible of struct exec_package (there are declarations,
	just not the definition) so ...

>How-To-Repeat:
	(Attempt to) Build a current kernel that does not PAX_ASLR
	in its config file.

>Fix:
	Not sure .. either unconditionally include sys/exec.h
	or #ifdef the line in question, or maybe something different.

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50312 CVS commit: src/sys/kern
Date: Thu, 8 Oct 2015 22:00:59 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Fri Oct  9 02:00:59 UTC 2015

 Modified Files:
 	src/sys/kern: kern_pax.c

 Log Message:
 PR/50312: Robert Elz: Unconditionally include <sys/exec.h> to fix compilation
 when PAX_ASLR is not defined.


 To generate a diff of this commit:
 cvs rdiff -u -r1.32 -r1.33 src/sys/kern/kern_pax.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 10 Oct 2015 19:48:22 +0000
State-Changed-Why:
christos fixed it


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.