plan9fox/sys/src
cinap_lenrek 7314601f9d pppoe: Avoid double free (thanks k0ga)
k0ga reports:

Hello,

While I was setting my pppoe conexion with my ISP
I discovered several problems in ip/pppoe. I used
the command line ip/pppoe -A '' ether0 and I got
this:

...
dropping unwanted pkt: wrong ac name
panic: D2B called on non-block dc10 (double-free?)
note rcved: sys: trap: fault read addr=0x0 pc=0x000066e1
pppoe 1013: suicide: sys: trap: fault read addr=0x0 pc=0x000066e1
cpu% acid 1013
/proc/1013/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: stk()
abort()+0x0 /sys/src/libc/9sys/abort.c:6
ppanic(p=0xd1b8,fmt=0xc7f9)+0x146 /sys/src/libc/port/malloc.c:166
D2B(p=0xd1b8,v=0xdc10)+0x57 /sys/src/libc/port/pool.c:926
poolfreel(v=0xdc10,p=0xd1b8)+0x20 /sys/src/libc/port/pool.c:1152
poolfree(p=0xd1b8,v=0xdc10)+0x3b /sys/src/libc/port/pool.c:1287
free(v=0xdc18)+0x23 /sys/src/libc/port/malloc.c:250
clearstate()+0x1b /sys/src/cmd/ip/pppoe.c:328
pppoe(ether=0xdfffefc1)+0x123 /sys/src/cmd/ip/pppoe.c:426
main(argv=0xdfffefa0,argc=0x1)+0x89 /sys/src/cmd/ip/pppoe.c:100
_main+0x31 /sys/src/libc/386/main9.s:16
acid:


clearstate() is called in pppoe.c:424, and it frees acname and sets it
to nil.  pktread() is called in pppoe.c:434 with parameter wantoffer,
which frees acname again in line pppoe.c:360 but doesn't set it to
nil, so clearstate() makes a double free in the next iteration.
2016-03-01 23:54:37 +01:00
..
9 devdraw: remove unused Edepth[] 2016-02-28 03:06:42 +01:00
ape ape/stdio: %z format is VLONG on amd64 2016-01-07 19:20:30 +01:00
boot
cmd pppoe: Avoid double free (thanks k0ga) 2016-03-01 23:54:37 +01:00
games games/doom: handle allocimage() failure 2016-02-28 11:44:53 +01:00
lib9p merge 2015-10-15 13:22:48 +02:00
libaml format pointer subtraction results with %zd instead of %ld (for long -> intptr on amd64) 2016-01-07 04:44:13 +01:00
libauth auth: release dp9ik implementation and reentrant factotum 2016-01-06 03:09:00 +01:00
libauthsrv libauthsrv: can write p = 2^448 - 2^224 - 1 now, as mpc has constant folding. 2016-02-22 22:56:55 +01:00
libavl
libbin
libbio
libc introduce signed intptr and %z format modifier for formating uintptr and intptr 2016-01-07 04:39:09 +01:00
libcomplete
libcontrol fix fuckup 2015-08-25 09:35:10 +00:00
libdisk
libdraw libdraw: remove unused static log2[] array 2016-02-28 01:38:29 +01:00
libfis libfis: dont reject drives lacking SSP (sata ssd connected to ide with adapter) 2016-02-22 22:53:19 +01:00
libflate format pointer subtraction results with %zd instead of %ld (for long -> intptr on amd64) 2016-01-07 04:44:13 +01:00
libframe
libgeometry
libhtml
libhttpd libhttpd: use strtol to parse decimal character references in httpunesc() 2015-08-03 15:26:33 +02:00
libip
libjson libjson: added printing support (thanks spew) 2015-12-22 18:12:56 +01:00
liblex
libmach fix fuckup 2015-08-25 09:35:10 +00:00
libmemdraw
libmemlayer libdraw: remove unused static log2[] array 2016-02-28 01:38:29 +01:00
libmp libmp: remove include of libsec.h 2016-02-05 19:29:55 -08:00
libndb
liboventi
libplumb
libregexp
libscribble
libsec libsec: fix verifyDHparams() for version <= TLS1.1 2016-03-01 11:30:01 +01:00
libstdio
libString
libsunrpc
libthread libthread: get rid of tprivalloc()/tprivfree()/tprivdata() and _workerdata() (thanks qrstuv) 2015-09-06 23:25:14 +02:00
libventi
mkfile
mkfile.proto mkfile.proto: LIB should not be inherited during recursive mk 2015-09-09 18:59:40 -07:00
NOTICE