Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'char-misc-5.15-rc1-lkdtm' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull misc driver fix from Greg KH:
"Here is a single patch for 5.15-rc1, for the lkdtm misc driver.

It resolves a build issue that many people were hitting with your
current tree, and Kees and others felt would be good to get merged
before -rc1 comes out, to prevent them from having to constantly hit
it as many development trees restart on -rc1, not older -rc releases.

It has NOT been in linux-next, but has passed 0-day testing and looks
'obviously correct' when reviewing it locally :)"

* tag 'char-misc-5.15-rc1-lkdtm' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
lkdtm: Use init_uts_ns.name instead of macros

+27 -11
+10
drivers/misc/lkdtm/core.c
··· 26 26 #include <linux/init.h> 27 27 #include <linux/slab.h> 28 28 #include <linux/debugfs.h> 29 + #include <linux/utsname.h> 29 30 30 31 #define DEFAULT_COUNT 10 31 32 ··· 211 210 MODULE_PARM_DESC(cpoint_count, " Crash Point Count, number of times the "\ 212 211 "crash point is to be hit to trigger action"); 213 212 213 + /* For test debug reporting. */ 214 + char *lkdtm_kernel_info; 214 215 215 216 /* Return the crashtype number or NULL if the name is invalid */ 216 217 static const struct crashtype *find_crashtype(const char *name) ··· 493 490 crash_count = cpoint_count; 494 491 #endif 495 492 493 + /* Common initialization. */ 494 + lkdtm_kernel_info = kasprintf(GFP_KERNEL, "kernel (%s %s)", 495 + init_uts_ns.name.release, 496 + init_uts_ns.name.machine); 497 + 496 498 /* Handle test-specific initialization. */ 497 499 lkdtm_bugs_init(&recur_count); 498 500 lkdtm_perms_init(); ··· 545 537 546 538 if (lkdtm_kprobe != NULL) 547 539 unregister_kprobe(lkdtm_kprobe); 540 + 541 + kfree(lkdtm_kernel_info); 548 542 549 543 pr_info("Crash point unregistered\n"); 550 544 }
+17 -11
drivers/misc/lkdtm/lkdtm.h
··· 5 5 #define pr_fmt(fmt) "lkdtm: " fmt 6 6 7 7 #include <linux/kernel.h> 8 - #include <generated/compile.h> 9 - #include <generated/utsrelease.h> 10 8 11 - #define LKDTM_KERNEL "kernel (" UTS_RELEASE " " UTS_MACHINE ")" 9 + extern char *lkdtm_kernel_info; 12 10 13 11 #define pr_expected_config(kconfig) \ 14 12 { \ 15 13 if (IS_ENABLED(kconfig)) \ 16 - pr_err("Unexpected! This " LKDTM_KERNEL " was built with " #kconfig "=y\n"); \ 14 + pr_err("Unexpected! This %s was built with " #kconfig "=y\n", \ 15 + lkdtm_kernel_info); \ 17 16 else \ 18 - pr_warn("This is probably expected, since this " LKDTM_KERNEL " was built *without* " #kconfig "=y\n"); \ 17 + pr_warn("This is probably expected, since this %s was built *without* " #kconfig "=y\n", \ 18 + lkdtm_kernel_info); \ 19 19 } 20 20 21 21 #ifndef MODULE ··· 25 25 if (IS_ENABLED(kconfig)) { \ 26 26 switch (lkdtm_check_bool_cmdline(param)) { \ 27 27 case 0: \ 28 - pr_warn("This is probably expected, since this " LKDTM_KERNEL " was built with " #kconfig "=y but booted with '" param "=N'\n"); \ 28 + pr_warn("This is probably expected, since this %s was built with " #kconfig "=y but booted with '" param "=N'\n", \ 29 + lkdtm_kernel_info); \ 29 30 break; \ 30 31 case 1: \ 31 - pr_err("Unexpected! This " LKDTM_KERNEL " was built with " #kconfig "=y and booted with '" param "=Y'\n"); \ 32 + pr_err("Unexpected! This %s was built with " #kconfig "=y and booted with '" param "=Y'\n", \ 33 + lkdtm_kernel_info); \ 32 34 break; \ 33 35 default: \ 34 - pr_err("Unexpected! This " LKDTM_KERNEL " was built with " #kconfig "=y (and booted without '" param "' specified)\n"); \ 36 + pr_err("Unexpected! This %s was built with " #kconfig "=y (and booted without '" param "' specified)\n", \ 37 + lkdtm_kernel_info); \ 35 38 } \ 36 39 } else { \ 37 40 switch (lkdtm_check_bool_cmdline(param)) { \ 38 41 case 0: \ 39 - pr_warn("This is probably expected, as this " LKDTM_KERNEL " was built *without* " #kconfig "=y and booted with '" param "=N'\n"); \ 42 + pr_warn("This is probably expected, as this %s was built *without* " #kconfig "=y and booted with '" param "=N'\n", \ 43 + lkdtm_kernel_info); \ 40 44 break; \ 41 45 case 1: \ 42 - pr_err("Unexpected! This " LKDTM_KERNEL " was built *without* " #kconfig "=y but booted with '" param "=Y'\n"); \ 46 + pr_err("Unexpected! This %s was built *without* " #kconfig "=y but booted with '" param "=Y'\n", \ 47 + lkdtm_kernel_info); \ 43 48 break; \ 44 49 default: \ 45 - pr_err("This is probably expected, since this " LKDTM_KERNEL " was built *without* " #kconfig "=y (and booted without '" param "' specified)\n"); \ 50 + pr_err("This is probably expected, since this %s was built *without* " #kconfig "=y (and booted without '" param "' specified)\n", \ 51 + lkdtm_kernel_info); \ 46 52 break; \ 47 53 } \ 48 54 } \