Bugzilla – Bug 62850
VUL-0: CVE-2004-0986: uninitialised variable in iptables
Last modified: 2021-11-09 14:47:45 UTC
We received the following report via vendor-sec. The issue is public. Date: Tue, 26 Oct 2004 16:32:18 +0200 From: Martin Schulze <joey@infodrom.org> To: vendor-sec@lst.de Subject: [vendor-sec] CAN-2004-0986: iptables and ip6tables fail to load ipt* kernel modules Hi, due to an uninitialised variable iptables and ip6tables fail to load the proper kernel modules, which may result in rules not implemented. The fix is easy and I'm attaching the official upstream correction. This problem is already public through our bugtracking system and netfilter-dev. Regards, Joey -- Testing? What's that? If it compiles, it is good, if it boots up, it is perfect. Index: iptables.c =================================================================== --- iptables.c (revision 3243) +++ iptables.c (working copy) int procfile; char *ret; +#define PROCFILE_BUFSIZ 1024 procfile = open(PROC_SYS_MODPROBE, O_RDONLY); if (procfile < 0) return NULL; - ret = malloc(1024); + ret = (char *) malloc(PROCFILE_BUFSIZ); if (ret) { - switch (read(procfile, ret, 1024)) { + memset(ret, 0, PROCFILE_BUFSIZ); + switch (read(procfile, ret, PROCFILE_BUFSIZ)) { case -1: goto fail; - case 1024: goto fail; /* Partial read. Wierd */ + case PROCFILE_BUFSIZ: goto fail; /* Partial read. Wierd */ } if (ret[strlen(ret)-1]=='\n') ret[strlen(ret)-1]=0; Index: ip6tables.c =================================================================== --- ip6tables.c (revision 3243) +++ ip6tables.c (working copy) int procfile; char *ret; +#define PROCFILE_BUFSIZ 1024 procfile = open(PROC_SYS_MODPROBE, O_RDONLY); if (procfile < 0) return NULL; - ret = malloc(1024); + ret = malloc(PROCFILE_BUFSIZ); if (ret) { - switch (read(procfile, ret, 1024)) { + memset(ret, 0, PROCFILE_BUFSIZ); + switch (read(procfile, ret, PROCFILE_BUFSIZ)) { case -1: goto fail; - case 1024: goto fail; /* Partial read. Wierd */ + case PROCFILE_BUFSIZ: goto fail; /* Partial read. Wierd */ } if (ret[strlen(ret)-1]=='\n') ret[strlen(ret)-1]=0;
*** Bug 62849 has been marked as a duplicate of this bug. ***
I fixed and submited packages for ul1, 8.2, 9.0, sles9, 9.2 and STABLE, you can create and submit patchinfo.
Created attachment 25709 [details] iptables.patch.box
Created attachment 25710 [details] iptables.patch.maintained
updates released.
CVE-2004-0986: CVSS v2 Base Score: 7.5 (AV:N/AC:L/Au:N/C:P/I:P/A:P)