diff options
author | Tim Yamin <plasmaroo@gentoo.org> | 2005-02-18 19:56:31 +0000 |
---|---|---|
committer | Tim Yamin <plasmaroo@gentoo.org> | 2005-02-18 19:56:31 +0000 |
commit | 137fa7d8c96a4171d1f9f5acb34611039c4a8bce (patch) | |
tree | a55b570c560bfcb1f8cf4dea6e21ebeb8660a9ca /sys-kernel/ck-sources | |
parent | amd64 stable (diff) | |
download | gentoo-2-137fa7d8c96a4171d1f9f5acb34611039c4a8bce.tar.gz gentoo-2-137fa7d8c96a4171d1f9f5acb34611039c4a8bce.tar.bz2 gentoo-2-137fa7d8c96a4171d1f9f5acb34611039c4a8bce.zip |
Fix #81106 patch for 2.4; bug #82479.
(Portage version: 2.0.51.16)
Diffstat (limited to 'sys-kernel/ck-sources')
-rw-r--r-- | sys-kernel/ck-sources/ChangeLog | 6 | ||||
-rw-r--r-- | sys-kernel/ck-sources/ck-sources-2.4.28-r3.ebuild | 4 | ||||
-rw-r--r-- | sys-kernel/ck-sources/files/ck-sources-2.4.28.81106.patch | 83 |
3 files changed, 90 insertions, 3 deletions
diff --git a/sys-kernel/ck-sources/ChangeLog b/sys-kernel/ck-sources/ChangeLog index bf0b2a5531cf..193310053b94 100644 --- a/sys-kernel/ck-sources/ChangeLog +++ b/sys-kernel/ck-sources/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-kernel/ck-sources # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ChangeLog,v 1.86 2005/02/16 20:40:20 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ChangeLog,v 1.87 2005/02/18 19:55:15 plasmaroo Exp $ + + 18 Feb 2005; <plasmaroo@gentoo.org> ck-sources-2.4.28-r3.ebuild, + +files/ck-sources-2.4.28.81106.patch: + Fix #81106 patch for 2.4; bug #82479. *ck-sources-2.4.28-r3 (15 Feb 2005) diff --git a/sys-kernel/ck-sources/ck-sources-2.4.28-r3.ebuild b/sys-kernel/ck-sources/ck-sources-2.4.28-r3.ebuild index 42b88941f47b..192a925bfbae 100644 --- a/sys-kernel/ck-sources/ck-sources-2.4.28-r3.ebuild +++ b/sys-kernel/ck-sources/ck-sources-2.4.28-r3.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ck-sources-2.4.28-r3.ebuild,v 1.1 2005/02/15 21:50:55 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ck-sources-2.4.28-r3.ebuild,v 1.2 2005/02/18 19:55:15 plasmaroo Exp $ ETYPE="sources" @@ -27,7 +27,7 @@ UNIPATCH_LIST="${DISTDIR}/patch-${PV}-lck${CKV}.bz2 ${FILESDIR}/${P}.77666.patch ${FILESDIR}/${P}.78362.patch ${FILESDIR}/${P}.78363.patch - ${FILESDIR}/${PN}-81106.patch" + ${FILESDIR}/${P}.81106.patch" DESCRIPTION="Full sources for the Stock Linux kernel Con Kolivas's high performance patchset" HOMEPAGE="http://members.optusnet.com.au/ckolivas/kernel/" diff --git a/sys-kernel/ck-sources/files/ck-sources-2.4.28.81106.patch b/sys-kernel/ck-sources/files/ck-sources-2.4.28.81106.patch new file mode 100644 index 000000000000..2cc0ab84ebb8 --- /dev/null +++ b/sys-kernel/ck-sources/files/ck-sources-2.4.28.81106.patch @@ -0,0 +1,83 @@ +# ChangeSet +# 2005/01/25 10:10:51+00:00 aia21@cantab.net +# NTFS: Add printk rate limiting for ntfs_warning() and ntfs_error() when +# compiled without debug. This avoids a possible denial of service +# attack. Thanks to Carl-Daniel Hailfinger from SuSE for pointing this +# out. +# +# <plasmaroo>: printk_ratelimit() backported from 2.6. +# +diff -Nru a/fs/ntfs/debug.c b/fs/ntfs/debug.c +--- a/fs/ntfs/debug.c 2005-02-15 12:38:26 -08:00 ++++ b/fs/ntfs/debug.c 2005-02-15 12:38:26 -08:00 +@@ -25,6 +25,48 @@ + #endif + + #include "debug.h" ++#include <linux/sched.h> ++ ++/* minimum time in jiffies between messages */ ++int printk_ratelimit_jiffies = 5*HZ; ++ ++/* number of messages we send before ratelimiting */ ++int printk_ratelimit_burst = 10; ++ ++/* ++ * printk rate limiting, lifted from the networking subsystem. ++ * ++ * This enforces a rate limit: not more than one kernel message ++ * every printk_ratelimit_jiffies to make a denial-of-service ++ * attack impossible. ++ */ ++int printk_ratelimit(void) ++{ ++ static spinlock_t ratelimit_lock = SPIN_LOCK_UNLOCKED; ++ static unsigned long toks = 10*5*HZ; ++ static unsigned long last_msg; ++ static int missed; ++ unsigned long flags; ++ unsigned long now = jiffies; ++ ++ spin_lock_irqsave(&ratelimit_lock, flags); ++ toks += now - last_msg; ++ last_msg = now; ++ if (toks > (printk_ratelimit_burst * printk_ratelimit_jiffies)) ++ toks = printk_ratelimit_burst * printk_ratelimit_jiffies; ++ if (toks >= printk_ratelimit_jiffies) { ++ int lost = missed; ++ missed = 0; ++ toks -= printk_ratelimit_jiffies; ++ spin_unlock_irqrestore(&ratelimit_lock, flags); ++ if (lost) ++ printk(KERN_WARNING "printk: %d messages suppressed.\n", lost); ++ return 1; ++ } ++ missed++; ++ spin_unlock_irqrestore(&ratelimit_lock, flags); ++ return 0; ++} + + /* + * A static buffer to hold the error string being displayed and a spinlock +@@ -53,6 +53,10 @@ + va_list args; + int flen = 0; + ++#ifndef DEBUG ++ if (!printk_ratelimit()) ++ return; ++#endif + if (function) + flen = strlen(function); + spin_lock(&err_buf_lock); +@@ -93,6 +97,10 @@ + va_list args; + int flen = 0; + ++#ifndef DEBUG ++ if (!printk_ratelimit()) ++ return; ++#endif + if (function) + flen = strlen(function); + spin_lock(&err_buf_lock); |