[PATCH 2.6.11.2][SECURITY] printk with anti-cluttering-feature

From: Bodo Eggert
Date: Sun Mar 20 2005 - 16:43:40 EST


Security fix against a log spamming DoS in tuner.c, compile-tested

Signed-Off-By: Bodo Eggert <7eggert@xxxxxx>

--- linux-2.6.11/drivers/media/video/tuner.c 2005-03-20 20:54:54.000000000 +0100
+++ hotfix/drivers/media/video/tuner.c 2005-03-20 21:10:33.000000000 +0100
@@ -1048,8 +1048,9 @@ static void set_tv_freq(struct i2c_clien
right now we don't have that in the config
struct and this way is still better than no
check at all */
- printk("tuner: TV freq (%d.%02d) out of range (%d-%d)\n",
- freq/16,freq%16*100/16,tv_range[0],tv_range[1]);
+ if(printk_ratelimit())
+ printk("tuner: TV freq (%d.%02d) out of range (%d-%d)\n",
+ freq/16,freq%16*100/16,tv_range[0],tv_range[1]);
return;
}
t->tv_freq(c,freq);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/