From e1399c8e3a76cdbeae5598f117fae8ab954afa3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20L=C3=B6pke?= <loepke@edfritsch.de>
Date: Sun, 8 May 2016 20:13:50 +0200
Subject: [PATCH] Added crash log from faulty buffer read.

---
 20160425/chardev-1write.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/20160425/chardev-1write.c b/20160425/chardev-1write.c
index 9cd2373..57b540f 100644
--- a/20160425/chardev-1write.c
+++ b/20160425/chardev-1write.c
@@ -193,7 +193,9 @@ device_write(struct file *filp, const char *buff, size_t len, loff_t * off)
         else {
 		int i;
 		for(i = 0; i < len; i++) //Save the given string
-			msg_username[i] = buff[i]; //Heres the CRASH
+			get_user(msg_username[i], buff + i);			
+			//msg_username[i] = buff[i]; //Heres the CRASH
+			//printk(KERN_INFO "Got %c at %d from %d bytes.\n", buff[i], i, (int)len);
 		for(i = len; i < USERBUF_LEN; i++) //Zeroing the rest of mem
 			msg_username[i] = 0;
 		printk(KERN_INFO "%s: Successfully got %d bytes!\n",
-- 
GitLab