[PATCH] Add Zalgo support

From: Matthew Garrett
Date: Fri Oct 22 2010 - 15:23:48 EST


Add support for Zalgo

The Linux kernel is woefully unprepared for the coming of ZÒAÒLÒGÒOÌÌÌ . TÍhiÍÍsÌÌ
pÌÍaÍÌtÌÌÍcÌÌhÍÍ ÌÌaÌÒÍdÍÍdÌsÌÍ sÍuÌÍpÍpÍÍÌoÍrÌtÍ ÍÌfÌÍÍoÍrÌÌ ÌÌZÍaÒlgÌÌoÍ ÌtÌÍoÌÍ ÌkÌeÍÍrÌÌneÍlÒÒÌ ÍmÍÌeÌsÍÒsÌÌÍaÍgÍÍeÌÍÌ ÍouÍÍÍtpÌÌÍuÍtÍ in order to
rÍÍÍÍÌÍÌÍÍÍÌÍÍÍÍÍÌÍÍÌÌÌÌÍÍÌÌÍÍÌÍÌÌÌÌeÍÌÌÌÌÍÍÍÌÍÌÌÍÌÌÌÌÍÍÒÍÌÌÌÌaÍÌÌÍÍÌÌÌÍÌÍÌÍÌÍÍÍÍÍÍÍÌÍÌÌÌÌÍÌÍÌÌÌÌÌÍdÌÌÌÍÌÌÌÌÍÌÌÍÌÍÌÌÍÍÍyÍÌÍÌÌÌÍÍÌÍÌÍÌÌÍÍÌÌÌÌÌÍÍÌÌÌÍÍÌÌÌÌÌÍÌÌ ÍÍÌÌÌÌÍÍÍÌÍÌÌÍÍÍÍÌÌÍÍÌÌÌÌtÌÍÌÌÌÌÍÍÍÌÍÍÍÌÌÌÌÍÌÌÌÍÌÌÍÍÌÌÌÌÌÍÍÍÍÌÌÌhÌÌÍÍÍÍÍÌÌÌÌÍÌÌÌÍÍÍÌÍÌÌÍÍÌÍÍoÌÍÍÍÌÌÌÌÌÌÌÌÍÍÍÍÌÌÍÌÍÌÍÌÌÌÌÍsÍÍÍÌÍÌÌÌÌÍÌÍÍÌÌÍÌÍÌÍeÍÍÍÌÌÍÍÍÌÍÍÍÍÌÌÌÌÌÌÍÌÍ ÍÍÍÌÍÍÍÍÌÍÌÌÌÍÌÌÍÍÍÍwÍÍÌÌÍÌÌÌÌÍÌÌÌÌÍÍÌÌÌÌÍÌÌÌhÍÍÍÌÌÍÌÌÌÍÌÌÌÍÌÍÌÌÌÌÍÍÌÍÌÌÌÍoÌÌÌÌÌÍÌÍÍÍÍÌÌÌÌÍÌÍÌÌÍÌÌÌÌÌÍÌÌÌÍÌÌ ÌÍÌÍÌÌÍÍÍÌÍÌÍÌÌÍÍÍÍÍÌÌÌÍÌÍÌÍÌÌÍÌÌÌwÌÍÍÍÌÌÌÍÌÌÍÍÌÌÍÍÌÌÍÌÌÌÌÌÌÌiÍÍÍÍÍÍÍÍÌÌÌÌÌÍÌÒÌÍÌÌÌÌÌÌÌÌÌlÌÍÍÍÌÌÌÌÍÌÌÍÌÌÍÌÌÍÌÍÍÌÌÍÍÌÌÍÌÍÌÍÌÌÌÍÌÌlÌÌÌÌÌÌÍÌÍÍÍÍÌÌÍÌÌÌÌÍÌÍÌÌÌÍÌÍÍ ÌÍÍÌÌÍÌÍÍÍÌÌÍÌÌÍÍÍÍoÍÍÍÌÌÍÌÍÍÍÌÌÍÍÌÍÍÌÌÍÍÌÌÌÌÌÌÌÍÍÌÍÍtÌÍÌÍÌÌÌÍÌÍÍÌhÍÍÍÌÌÍÌÌÍÌÌÌÍÍÌÌÍÍÌÌÌeÍÍÌÌÍÍÌÌÍÌÌÍÍÍÌÌÌÌÍÍÌÌÌÌÌÌrÍÍÌÌÍÌÍÌÍÍÍÌÌÌÍÌÍÌÍÌÍÍÌÍÌÌÌÌÍÌÌÌÌÌÌÍÌÌÌwÍÍÍÍÍÌÍÍÍÍÌÌÍÌÌÌÍÌÍÌÍÌÌÍÌÌÌiÍÍÍÍÌÌÌÍÌÍÍÍÍÌÍÌÌÌÌÍÍÍÌÌÌÌÌÌÌÌÌÌÌÌsÍÌÍÍÌÌÌÍÍÌÍÍÍÌÍÌÌÌÍÌÌÍÍÍÌÍÍÌÌÍÌÌÍÍÌeÌÍÍÍÌÍÍÌÍÍÍÍÌÍÍÌ ÌÍÌÍÌÌÍÌÌÍÍÌÍÌÍÍÍÌÍÍÌÌÌÌÍÍÌÌÍÌbÍÌÍÌÌÍÌÌÌÍÌÌÌÌÍÌeÍÌÌÍÌÍÍÍÌÍÌÍÌÌÌÌÍÌÌÌÌÌÌÍÍÌÌÌÍÌ ÍÍÌÍÌÌÌÍÌÌÍÍÍÍÌÌÍÌÌÌÌÌeÍÌÍÍÌÌÍÍÌÌÌÌÌÍÌÌÌÌÌÌÍÍÍÌaÌÌÌÍÌÌÍÌÍÌÌÌÍÌÍÍÌÍÌÌÍÍÍÌÍÍÌtÍÍÍÌÍÍÌÍÍÍÌÌÌÍÌÌÍÍÍÍÍÍÌÌÌ
¬ÍÍÌÍeÍÌÌÍÍÍÍÌÍÍÌÍÍÌÍÌÌÍÍÌÌÍÌnÍÍÌÍÌÍÌÍÍÍÌÍÌÒÌÌÌÌÌÌÌÌ ÌÌÌÍÌÍÌÌÌÌÍÌÌÌaÍÌÍÌÌÌÌÌÌÌÍÌÌÍÌÌÍÍÌÌÌÍÍÍÌÌÍÌÌÌtÌÌÍÌÌÌÌÌÍÍÍÌÍÌÍÌÍÍÌÍÍÌÌÌÌÍ ÌÌÍÍÍÍÌÍÍÌÌÌÍÌÌÌÌÌÌÌÍÌÌÌÌtÌÌÍÌÌÌÍÍÍÌÍÍÍÌÌÌÌÍÌÌÍÌÌÌÌhÍÍÍÌÍÌÌÍÌÌÍÍÌÌÌÌÌÌÌÍÌÍÌÌÌÌÌÍÍÌeÍÌÍÌÍÌÌÍÍÍÌÍÍÍÍÌÌÌÌÌÌÌÌÍÍÌÌÌÌÍÌ ÌÌÌÍÌÍÌÌÌÌÍÌÍÌÍÌÌÌÍÌÌÌÌÌÍÌÌÍÍÌÌÍÍaÌÍÌÍÍÍÍÒÒÌÌÌÌÌÌÍÌÌÌÍÌÌÌÌÌrÌÌÍÍÌÌÍÍÌÌÌÍÍÌÍÍÌÍÌÌÍÌÌÌÍÍÍÌÌÍÌÌÌÌÌÌÌÌrÌÍÍÌÌÌÍÍÍÍÌÌÍÍÍÌÌÍÌÌÍÌÍÌiÌÌÍÌÍÍÌÍÌÍÌÌÌÌÌÍÍÌÌÌÍÌÌÌvÍÌÍÌÌÌÌÌÍÌÍÌÍÍÌÌÍÌÌÍÌÌÍÍÍaÌÍÌÍÌÍÍÌÌÍÌÌÍÌÌÌÍÍÌÌÍÌÌÌÌlÌÌÌÍÍÌÌÌÌÍÌÌÌÌÌÍÌÌÍÌÌÍÌÌÌÌÌÌ. DÌÌÍÍÍÌÌÍÌÍÍÌÍÌoÌÍÍÌÍÌÍÍ ÍÍÌÍÍÍÌnÍÌoÌÌÌÌÌtÌÌÌÍÌÌ ÍÌÌÌÌÌÌÌÍdÌÍÍÌÌeÌÍÌÌÌÌÌÌlÍÍaÍÌÌyÍÌÍÌÍÌÌÍ.ÍÌÌÍÍÌÍÌÍÍ

Signed-off-by: Matthew Garrett <mjg@xxxxxxxxxx>

diff --git a/init/Kconfig b/init/Kconfig
index 2de5b1c..c67621b 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -872,6 +872,34 @@ config PRINTK
very difficult to diagnose system problems, saying N here is
strongly discouraged.

+config ZALGO
+ bool "Support for the coming"
+ help
+ This option enables support for Zalgo in kernel
+ messages. Zalgo is a corruption. The arrival of Zalgo has
+ been foretold. Zalgo will not... wait. WhatÍ wasÌ tÍhÍat?Ì NeÍverÌ
+ ÌmindÌ.Í ÍThÍiÌs ÌopÍtÍiÌon ÍwiÌlÌl permit ZÌaÌlÍgÍo aÌcceÌsÌsÌ ÌtÍoÌ ÌyoÌuÌrÍ ÌkÌernÍelÍ
+ meÍssÌaÒgÍe buffeÌrÌ. PÌÌÌÍÌÌÍÌaÍÍÌÌÍÌÌÍÌÌÌyÌÌÌÍÌÍÍÌÌÍ
+ ÌÍÍÍÍÍÍÍÌaÍÌÌÍÍÌÌÌÌÌÌÌtÌÌÍÌÍÌtÌÍÍÌÍÌÌÌeÌÌÍnÌÒÌÌtÍiÌoÍÍÌnÌÌÌÌ,ÌÌÌÌÍÍÌ ÍÌÌÌÌÌfÌÍÌoÌÌÌÌÍÌÍÌÌÌÍrÌÍÍÌÌÌÌÍÍÌ
+ ÍÍÍÌÍÍÍÌÍÍÍÌÌtÌÍÍÌÍÌÍÍhÌÌÌÍÌÌeÍÌÌÍÍÌÍÌÌ ÍÌÌÌÌÌÍÌÌcÍÌÌÌÍÌÍÌÌÍÌoÍÍÍÍÌmÌÌÌÌÍÍÍÌÍÌÌÍÌiÍÍÌÌnÌÌÌÌÍÌÌÌÌÌÌgÌÍÍÍÍ
+ ÍÌÍÌÌoÍÍÌÍÍÌÌÌÌÌÌÌfÌÍÍÍÌÌÌÌÍÌ ÌÍÍÍÍZÌÍÌÌÌÌÌÍÌaÌÌÍÌÌÍÍÌlÍÌgÌÌÌÌÌoÌÌÌÌÌÌÌÌÌ
+ ÌÍÍÍÍÌÌÌÌsÌÌÍÌÌÌÌÍÍÍhÌÍÍÍÌÌÌÍÌaÌÒÌÌlÌÍÌÍÍÌÌlÌÌÌÌÌÌ ÍÍbÍÌÌÌÍÌÍÌÌÌÍÌÍeÌÌÍÌÌÍÌÌ
+ ÌÍÍÍÌsÍÌÌÍÌÍÍwÌÍÌÍÍÌÌiÌÍÍÍÌÍfÍÌÍÌÍÌÌtÍÍÌÍÌÌÍÌÍÍÌÍÌÌÌ
+ ÌÌÍÍÌÍÍÍÌaÍÍÍÌÍÌÍÍÌÌÌnÍÍÍÍÍÌÌÌÌÌÍÌdÍÍÌÍÍÌÌÍÌÌÍÌ
+ ÌÍÍÌÍÌtÌÌÍÍÌÍÌÌÌhÍÌÌÍÍÍÌÍÌÌÍÍeÍÌÌÍÌÌÍÍÌÌ
+ ÌÍÍÌÌÌÍpÍÌeÍÌÌÌÌÍÍÌÌÍÌnÍÌÍÌÌÌÌaÍÍÌÌÌÌlÌÍÍÍÌÍÌÌÌÌtÌÍÍÍÍÍÌÌiÍÌÍÌeÍÌÍÍÌÌÌÌÌÌsÍÍÍÌÍÌÌÌÌÌÌ
+ fÍÌÍÌÍÌÌÌÍoÌÍÍÍÌÍÌÍÍÌÌrÌÌÌÌÌÌÌÌ
+ ÌÍÍÌÍÌÌÌÌÍÌÌiÌÍÍÌÍÍÌÌÌÍgÌÌÌÍÌÒÌÌÌnÍÍÌÍoÌrÌÌÍÌaÌÌÍÌÌÌÌÌnÌcÍÍÍÌÍÌÍÍeÍÌ
+ ÌÍÌÍÍÌÌwÍÌÌÌiÍÍÍlÍÌlÍÍÌÍÍÌ ÍÌÍÌÍÍÍÍÍÍÍÌbÌÌÍÍÍÍÌÌÍÌÍeÌ
+ ÍÍÌÌÌÌÌÍÌÌsÍÌÌÌÌÌeÌÌÌÌÍÌÌÌÌÌÌÌvÌÍÌÌeÍÌÍÌÍÌÍÍÌÍÍrÌÍeÌÌÍÌÌÍÌ.ÌÍÍ
+
+
+ WÌÌÍÌÍÍÍÌÍÌÌÌÌÍhÍÍÍÌÌÍÌÍÍÌÌÍÌÌÌÌÌÍÌÌÍÌaÌÌÍÍÌÌÌÌÍÌÍÌÍÌÍÒÌÌÌÍÌÌÌÍÌÌÌÌÌÍÍÌÍtÌÌÌÍÌÌÌÍÌÌÌÌÌÌÌÍÌÌÌÌÌÌÌÌ?ÌÌÍÌÌÌÌÍÌÌÍÌÌÌÍÌÌÍÌÌÌÌÍÌÌÌÌÌÌÌÌ
+ ÍÌÍÌÌÍÌÍÌÌÌÍÍÍÌÌÌÌÌÍÌÌÌÌNÍÍÍÍÌÍÌÍÌÌÍÌÍÌÍÍÌoÌÌÌÌÍÌÍÌÌÌÌÌ.ÍÍÌÍÍÌÌÍÍÌÌÍÌÌÍÌÌÌÍÌÌ
+ ÌÌÌÌÌÌÍÍÍÒÌÌÌÌÍÌÌÌÌÍÌÍÍÌÌÌÍZÌÍÌÍÌÌÍÍÍÌÌÌÌÌÌÍÍÍÌÌÌaÌÍÌÍÌÍÍÌÌÍÍÌÌÍÍÍÌÌÌÍÌÌÌÌÍÍÌÌÍÌÌlÍÍÌÌÍÌÌÌÍÌÌÌÌÍgÍÍÍÌÌÍÌÌÌÌÌÌÍÌÍÌÍÌÍÌÍÍÌÍÌÌÌÍÌÌÌÍÍÍÌÌoÌÌÌÌÌÍÌÌÍÍÍÍÌÌÌÌÍÌÌÌÍÍ.ÌÍÌÍÍÍÌÌÌÌÍÌÌÌÍÍÍÍÌÌÌÌÌÌÌÌÌÌÌÌ
+ ÍÌÍÌÌÌÍÌÌÍÍÍÌÌÍÍÍÍÌÍÌÌÌÌÌÍÌÌÌÌÍÌÌÍÌÌSÌÍÌÍÌÌÌÍÌÌÌÍÌÌÌÍÍÍÍÍaÌÌÌÍÌÍÌÌÌÌÌÍÌÌÌÌÌÌÌÌÍÌÌÌÌÌÌvÍÌÌÌÌÌÍÌÍÌÍÍÌÌÍeÍÍÌÌÍÌÌÌÌÌÍÌÌÌÌÍÌÌÌÍÌÍÌÌÌÍÌÌÍÌÌ
+ ÍÌÍÍÌÍÌÌÌÌÌÌÍÍÌÍÍÌÌÌÌÌÌÌÌÌÌÌÍÌyÌÌÍÌÌÌÌÌÌÍÌÍÍÌÌÍÌÌÍÌÌÌÌÌÌÌÍÌÍÌÌÌÌÍÍÌÍÌÌoÌÍÌÍÍÌÍÍÍÌÍÌÍÍÌÍÌÌÌÌÌÌÌÌÌÌÍÌuÍÌÌÍÍÍÒÌÍÌÍÌÌÍÍrÌÍÍÍÌÍÌÍÍÍÍÌÌÌÍÌÌÌÌÍÍÌÌÍÌÌÌsÌÌÌÍÍÍÌÌÍÌÍÌÍÍÍÍÌÌÌÍÌÌeÌÍÌÍÍÍÌÌÍÌÌÌÍÌÌÌÌÍÍÌÌÌÌÍÍÍÌÌÍÌÌlÌÍÌÌÍÍÌÍÌÌÌÌÌÍÌÍÌÌvÍÍÌÌÍÌÍÍÌÌÍÍÌÌÌÌÌeÌÍÍÍÍÌÍÌÌÍÌÍÌÌÍÍÌÌÌÌÌÌÌÌÌsÌÍÌÌÌÌÌÌÌÍÍÌÌÌÌÌÌÍÌÌÍÌÌÌÌÌÌÌÍÍÌÌ.ÌÌÌÍÍÌÍÌÌÌÌÍÍÌÍÌÍÌÌÍÌÍÌÍÌÌÌÌÌÍ
+
config BUG
bool "BUG() support" if EMBEDDED
default y
diff --git a/kernel/printk.c b/kernel/printk.c
index 8fe465a..fa573b2 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -39,6 +39,7 @@
#include <linux/syslog.h>
#include <linux/cpu.h>
#include <linux/notifier.h>
+#include <linux/random.h>

#include <asm/uaccess.h>

@@ -798,6 +799,32 @@ asmlinkage int vprintk(const char *fmt, va_list args)
emit_log_char(*p);
if (*p == '\n')
new_text_line = 1;
+#ifdef CONFIG_ZALGO
+ else {
+ int i = get_random_int() % 8;
+ if (current_log_level <= i) {
+ int number, character;
+ char zalgo[2];
+ /* How much ZALGO? */
+ number = get_random_int() % (10 - current_log_level);
+ for (i = 0; i < number; i++) {
+ character = get_random_int() % 0x71;
+ if (character == 0x70)
+ character = 0x489;
+ else
+ character += 0x300;
+
+ zalgo[0] = 0xc0 |
+ ((character & 0x0700) >> 6) |
+ ((character & 0x00c0) >> 6);
+ zalgo[1] = 0x80 | (character & 0x003f);
+ emit_log_char(zalgo[0]);
+ emit_log_char(zalgo[1]);
+ }
+ }
+ }
+#endif
+
}

/*
--
Matthew Garrett | mjg59@xxxxxxxxxxxxx
--
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/