Hello community, here is the log from the commit of package module-init-tools checked in at Wed Dec 20 18:18:13 CET 2006. -------- --- module-init-tools/module-init-tools.changes 2006-12-12 21:12:33.000000000 +0100 +++ /mounts/work_src_done/STABLE/module-init-tools/module-init-tools.changes 2006-12-20 15:39:10.000000000 +0100 @@ -1,0 +2,7 @@ +Wed Dec 20 15:18:41 CET 2006 - mmarek@suse.cz + +- make the fastgetline() function reentrant (at a little + performance cost) to avoid using freed memory when recursively + reading config files [#229661] + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ module-init-tools.spec ++++++ --- /var/tmp/diff_new_pack.X0j6zx/_old 2006-12-20 18:14:45.000000000 +0100 +++ /var/tmp/diff_new_pack.X0j6zx/_new 2006-12-20 18:14:45.000000000 +0100 @@ -13,7 +13,7 @@ Name: module-init-tools BuildRequires: dietlibc dietzlib Version: 3.2.2 -Release: 63 +Release: 67 %define ver 3.2.2 License: GNU General Public License (GPL) Group: System/Kernel @@ -50,10 +50,10 @@ %description Utilities for loading kernel modules. Included are 'insmod', 'lsmod', 'rmmod', 'depmod', and 'modprobe'. The configuration file -/etc/modutils.conf can be used to pass parameters to the modules. -'depmod' should be used after compiling a new kernel to generate the -dependency information. 'insmod' does not use the dependency nor the -options file. Therefore, 'modprobe' is normally used to load a module. +/etc/modprobe.* can be used to pass parameters to the modules. 'depmod' +should be used after compiling a new kernel to generate the dependency +information. 'insmod' does not use the dependency nor the options file. +Therefore, 'modprobe' is normally used to load a module. @@ -150,6 +150,10 @@ /etc/modprobe.d %changelog -n module-init-tools +* Wed Dec 20 2006 - mmarek@suse.cz +- make the fastgetline() function reentrant (at a little + performance cost) to avoid using freed memory when recursively + reading config files [#229661] * Tue Dec 12 2006 - mmarek@suse.cz - fixed options-priority.diff [#226907] * Mon Nov 06 2006 - nadvornik@suse.cz ++++++ module-init-tools-3.2.2-modprobe-fastgetline.diff ++++++ --- /var/tmp/diff_new_pack.X0j6zx/_old 2006-12-20 18:14:46.000000000 +0100 +++ /var/tmp/diff_new_pack.X0j6zx/_new 2006-12-20 18:14:46.000000000 +0100 @@ -1,6 +1,6 @@ --- modprobe.c +++ modprobe.c -@@ -127,6 +127,7 @@ +@@ -127,6 +127,7 @@ static void print_usage(const char *prog exit(1); } @@ -8,17 +8,16 @@ static int fgetc_wrapped(FILE *file, unsigned int *linenum) { for (;;) { -@@ -165,6 +166,49 @@ +@@ -165,6 +166,46 @@ static char *getline_wrapped(FILE *file, buf[i++] = ch; } } -+#define GETL_FREE(x) free(x) +#else -+char *lnbuf = 0; size_t blen = 0; +char *lnbuf2 = 0; size_t blen2 = 0; +static char *fastgetline(FILE* file, unsigned int *linenum) +{ + ssize_t n, n2; ++ char *lnbuf = 0; size_t blen = 0; + n = getline(&lnbuf, &blen, file); + if (n < 0) { + if (lnbuf) @@ -34,7 +33,7 @@ + while (n && lnbuf[n-1] == '\\') { + lnbuf[--n] = 0; + n2 = getline(&lnbuf2, &blen2, file); -+ if (n2 < 0) ++ if (n2 < 0) + return lnbuf; /* We'll be called again ... */ + if (n2 && lnbuf2[n2-1] == '\n') /* should always be true */ + lnbuf2[--n2] = 0; @@ -52,84 +51,7 @@ + return lnbuf; +} +#define getline_wrapped fastgetline -+#define GETL_FREE(x) do {} while (0) +#endif -+ static struct module *find_module(const char *filename, struct list_head *list) { -@@ -323,7 +367,7 @@ - from boot/ */ - while (!done && (line = getline_wrapped(modules_dep, NULL)) != NULL) { - done = add_modules_dep_line(line, start_name, list); -- free(line); -+ GETL_FREE(line); - } - fclose(modules_dep); - free(modules_dep_name); -@@ -392,18 +436,18 @@ - if (streq(entry, "Loading") - || streq(entry, "Unloading")) { - usleep(100000); -- free(line); -+ GETL_FREE(line); - fclose(proc_modules); - goto again; - } - } - - out: -- free(line); -+ GETL_FREE(line); - fclose(proc_modules); - return 1; - } -- free(line); -+ GETL_FREE(line); - } - fclose(proc_modules); - return 0; -@@ -1098,7 +1142,7 @@ - printf("%s\n", line); - } - next: -- free(line); -+ GETL_FREE(line); - } - - free(wcard); -@@ -1256,7 +1300,7 @@ - } else - grammar(cmd, filename, linenum); - -- free(line); -+ GETL_FREE(line); - } - fclose(cfile); - return 1; -@@ -1280,13 +1324,15 @@ - dir = opendir(filename); - if (dir) { - struct dirent *i; -+ char *dirname; -+ dirname = strdup(filename); - while ((i = readdir(dir)) != NULL) { - if (!streq(i->d_name,".") && !streq(i->d_name,"..") \ - && config_filter(i->d_name)) { -- char sub[strlen(filename) + 1 -+ char sub[strlen(dirname) + 1 - + strlen(i->d_name) + 1]; - -- sprintf(sub, "%s/%s", filename, i->d_name); -+ sprintf(sub, "%s/%s", dirname, i->d_name); - if (!read_config(sub, name, - dump_only, removing, options, - commands, aliases, blacklist)) -@@ -1295,6 +1341,7 @@ - sub, strerror(errno)); - } - } -+ free(dirname); - closedir(dir); - ret = 1; - } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@suse.de