printk.c (93cd6fa6806cb3455e8231578840afb031606352) | printk.c (cbbd26b8b1a6af9c02e2b6523e12bd50cc765059) |
---|---|
1/* 2 * linux/kernel/printk.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 * 6 * Modified to make sys_syslog() more flexible: added commands to 7 * return the last 4k of kernel messages, regardless of whether 8 * they've been read or not. Added option to suppress kernel printk's --- 734 unchanged lines hidden (view full) --- 743 return ret; 744 } 745 746 buf = kmalloc(len+1, GFP_KERNEL); 747 if (buf == NULL) 748 return -ENOMEM; 749 750 buf[len] = '\0'; | 1/* 2 * linux/kernel/printk.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 * 6 * Modified to make sys_syslog() more flexible: added commands to 7 * return the last 4k of kernel messages, regardless of whether 8 * they've been read or not. Added option to suppress kernel printk's --- 734 unchanged lines hidden (view full) --- 743 return ret; 744 } 745 746 buf = kmalloc(len+1, GFP_KERNEL); 747 if (buf == NULL) 748 return -ENOMEM; 749 750 buf[len] = '\0'; |
751 if (copy_from_iter(buf, len, from) != len) { | 751 if (!copy_from_iter_full(buf, len, from)) { |
752 kfree(buf); 753 return -EFAULT; 754 } 755 756 /* 757 * Extract and skip the syslog prefix <[0-9]*>. Coming from userspace 758 * the decimal value represents 32bit, the lower 3 bit are the log 759 * level, the rest are the log facility. --- 2554 unchanged lines hidden --- | 752 kfree(buf); 753 return -EFAULT; 754 } 755 756 /* 757 * Extract and skip the syslog prefix <[0-9]*>. Coming from userspace 758 * the decimal value represents 32bit, the lower 3 bit are the log 759 * level, the rest are the log facility. --- 2554 unchanged lines hidden --- |