well, we are not hang to dry after all.

"Alex Kramarov" <[email protected]>
Newsgroups gmane.network.tux
Message-ID <000c01c2778e$cbcb87d0$0101c80a@home>
sorry about the last message, the tux in the latest redhat kernels is
different from the A3 patch, but it is not the logging patch - it is
something about how all redhat's kernel is modified to use different
functions for "yield()" and "SCHED_YIELD" - does anyone know what is it all
about ? (the diff between the original files and redhat's are attached, hope
it will go through) .

i will probably put it to the test on my servers in the near future - will
see how it performs.

anyway, i have asked sometime ago what about gzip.c in tux - does it contain
functions that are vunerable to the last gzip exploits - anyone ? i run tux
and don't enable compression, but i am concerned anyway ...
diff.txt (text/plain, 2.8 KB)
diff -ur tux/cachemiss.c /usr/src/linux-2.4/net/tux/cachemiss.c
--- tux/cachemiss.c     Sat Oct 19 18:31:18 2002
+++ /usr/src/linux-2.4/net/tux/cachemiss.c      Tue Oct  8 16:53:31 2002
@@ -118,7 +118,7 @@

                mask = 1 << nr;
                if (cpu_online_map & mask)
-                       current->cpus_allowed = mask;
+                       set_cpus_allowed(current, mask);
        }
 #endif

diff -ur tux/cgi.c /usr/src/linux-2.4/net/tux/cgi.c
--- tux/cgi.c   Sat Oct 19 18:31:18 2002
+++ /usr/src/linux-2.4/net/tux/cgi.c    Tue Oct  8 16:53:31 2002
@@ -146,9 +146,9 @@
                unsigned int mask = cpu_online_map & tux_cgi_cpu_mask;

                if (mask)
-                       current->cpus_allowed = mask;
+                       set_cpus_allowed(current, mask);
                else
-                       current->cpus_allowed = cpu_online_map;
+                       set_cpus_allowed(current, cpu_online_map);
        }
 #endif

diff -ur tux/logger.c /usr/src/linux-2.4/net/tux/logger.c
--- tux/logger.c        Sat Oct 19 18:31:18 2002
+++ /usr/src/linux-2.4/net/tux/logger.c Tue Oct  8 16:53:31 2002
@@ -704,7 +704,7 @@
         * Reduce the cache footprint of the logger file - it's
         * typically write-once.
         */
-       flush_inode_pages(log_filp->f_dentry->d_inode);
+//     flush_inode_pages(log_filp->f_dentry->d_inode);

 out_lock:
        spin_lock(&log_lock);
@@ -739,7 +739,7 @@
                unsigned long mask = log_cpu_mask;

                if (cpu_online_map & mask)
-                       current->cpus_allowed = mask;
+                       set_cpus_allowed(current, mask);
        }
 #endif

diff -ur tux/main.c /usr/src/linux-2.4/net/tux/main.c
--- tux/main.c  Sat Oct 19 18:31:18 2002
+++ /usr/src/linux-2.4/net/tux/main.c   Tue Oct  8 16:53:31 2002
@@ -393,8 +393,7 @@
        unsigned int cpu;

 repeat:
-       current->policy |= SCHED_YIELD;
-       schedule();
+       yield();

        for (cpu = 0; cpu < nr_tux_threads; cpu++) {
                ti = threadinfo + cpu;
@@ -418,10 +417,8 @@
                        struct socket *sock;

                        sock = ti->listen[i].sock;
-                       while (waitqueue_active(sock->sk->sleep)) {
-                               current->policy |= SCHED_YIELD;
-                               schedule();
-                       }
+                       while (waitqueue_active(sock->sk->sleep))
+                               yield();
                        sock_release(sock);
                }
                ti->listen[i].sock = NULL;
@@ -444,7 +441,7 @@

                mask = 1 << ((cpu + tux_cpu_offset) % smp_num_cpus);
                if (cpu_online_map & mask)
-                        current->cpus_allowed = mask;
+                        set_cpus_allowed(current, mask);
        }
 #endif
        ti->thread = current;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.