[grsec] Signal handling with SA_SIGINFO broken on 2.6.30.4-200908051916

Natanael Copa natanael.copa at gmail.com
Fri Aug 7 08:28:43 EDT 2009


Hi,

Signal handlers with SA_SIGINFO does not work on x86 with
grsecurity-2.1.14-2.6.30.4-200908051916.patch 08/05/09 19:18


A testcase (from Timo):

#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ucontext.h>

static void
handle_sigsegv(int sig, siginfo_t *info, void *uctxp)
{
	ucontext_t *uctx = uctxp;
	fprintf(stderr, "sigsegv: sig=%d, info=%p, uctxp=%p\n",
			sig, info, uctxp);
	exit(0);
}

int main(void)
{
	struct sigaction act;
	char *fault = NULL;

	memset(&act, 0, sizeof(act));
	act.sa_sigaction = handle_sigsegv;
	act.sa_flags = SA_SIGINFO;
	sigaction(SIGSEGV, &act, NULL);

	fault[0] = 0;
}


The testcase works with 2.6.30.4 vanilla and 2.6.29.x with grsecurity
patches. With the 2.6.30.4 series up to 200908051916 the testcase
segfaults.

Signal handling without SA_SIGINFO seems work though.

The vmlinux.bin:
http://dev.alpinelinux.org/~ncopa/pax/vmlinux.bin

The kernel config:
http://git.alpinelinux.org/cgit/aports/tree/main/linux-grsec/kernelconfig

And the timestamp on the grsecurity patch: 200908051916

Thanks!

-nc



More information about the grsecurity mailing list