Subject: misc/35495: can't budil kernel with USE_SSP=yes
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <aniou@smutek.pl>
List: netbsd-bugs
Date: 01/26/2007 23:05:00
>Number:         35495
>Category:       misc
>Synopsis:       can't budil kernel with USE_SSP=yes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 26 23:05:00 +0000 2007
>Originator:     Piotr Meyer
>Release:        4.0_BETA2
>Organization:
>Environment:
NetBSD czyzyk 4.0_BETA2 NetBSD 4.0_BETA2 (GENERIC) #0: Fri Jan 26 16:46:37 CET 2007  root@czyzyk:/usr/obj/sys/arch/i386/compile/GENERIC i386

>Description:
With "USE_SSP=yes" in /etc/mk.conf it's impossible to build kernel (either by ./build.sh and config/make):

# make
making sure the compat library is up to date...
#   compile  compat/kern_exit_43.o
cc -ffreestanding -fno-zero-initialized-in-bss -march=i486 -mtune=pentiumpro  -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-sign-compare -Wno-pointer-sign -Wno-attributes -Wextra -Wno-unused-parameter  -fno-strict-aliasing -fstack-protector -Wstack-protector --param ssp-buffer-size=1   -Di386 -I../../. -I../../../../../../contrib/dev/ath/netbsd -I../../../../../../../common/include -I../../../../../../arch -I../../../../../.. -nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -I../../../../../../lib/libkern/../../../common/lib/libc/quad -I../../../../../../lib/libkern/../../../common/lib/libc/string -I../../../../../../lib/libkern/../../../common/lib/libc/arch/i386/string -I../../../../../../dist/ipf    -c    ../../../../../../compat/common/kern_exit_43.c -o kern_exit_43.o
cc1: warnings being treated as errors
../../../../../../compat/common/kern_exit_43.c: In function 'compat_43_sys_wait':
../../../../../../compat/common/kern_exit_43.c:78: warning: not protecting function: no buffer at least 1 bytes long
*** Error code 1

Stop.
make: stopped in /usr/src/sys/arch/i386/compile/GENERIC/lib/compat
*** Error code 1

Stop.
make: stopped in /usr/src/sys/arch/i386/compile/GENERIC



In /usr/src/sys/conf/Makefile.kern.inc (ver 1.94.2.3 2006/12/20 22:54:32) I found some directives that should deal with this problem but looks like they not working:

[...]
# The following files use alloca(3) or variable array allocations,
# or, in the case of kern_exit_43.c, an array of size 0 on the stack.
# Their full name is noted as documentation.
VARSTACK=dev/cgd.c kern/uipc_socket.c miscfs/genfs/genfs_vnops.c \
    nfs/nfs_bio.c ufs/ufs/ufs_inode.c ufs/ufs/ufs_lookup.c uvm/uvm_bio.c \
    uvm/uvm_pager.c dev/ic/aic7xxx.c dev/ic/aic79xx.c arch/xen/i386/gdt.c \
    compat/common/kern_exit_43.c

.for __varstack in ${VARSTACK}
COPTS.${__varstack:T} += -Wno-stack-protector
.endfor
[...]



>How-To-Repeat:
Put USE_SSP=yes into /etc/mk.conf and try to build new kernel.
>Fix: