Subject: Re: propolice in libc
To: None <tech-toolchain@NetBSD.ORG>
From: Robert Connolly <cendres@videotron.ca>
List: tech-toolchain
Date: 03/18/2004 16:39:36
Hello. This patch adds propolice functions to libc:
https://twocents.mooo.com/patches/downloads/NetBSD/netbsd-1.6ZK-ssp-libc-2.patch

I tested it against this:
cat > fail.c << "EOF"
#include <stdio.h>
#include <unistd.h>
int foo(char *blah) {
  char buffer[7];
  sprintf(buffer, "12345678901234567890123456789012345678901234567890");
  return(1234);
}
int main(int argc, char **argv) {
  printf("before foo()\n");
  foo("blah");
  printf("after foo()\n");
}

And:
(gdb) run
Starting program: /root/sources/gcc-build/fail
before foo()
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGABRT, Aborted.
0x48078ccb in kill () from /usr/lib/libc.so.12

The kill is coming from libc, looks like it works. This patch is 
using /dev/urandom, obsd is using KERN_ARND which is preferred. I'll try to 
port over to ARND soon.