Skip to content

Commit d21bece

Browse files
committed
Feature: commit id and srcversrion added
version double-checking for cases the kmod version has to be changed back to old versions Signed-off-by: shenping.matt <shenping.matt@bytedance.com>
1 parent 6638bbc commit d21bece

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

driver/LKM/src/smith_hook.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5004,14 +5004,23 @@ static void __init install_kprobe(void)
50045004
}
50055005
}
50065006

5007+
#define SMITH_SRCID(name) \
5008+
#name; \
5009+
static char *sid_##name = #name; \
5010+
module_param(sid_##name, charp, S_IRUSR|S_IRGRP|S_IROTH)
5011+
5012+
/* latest commit id */
5013+
static char *smith_srcid = SMITH_SRCID(6638bbc49a041916c5a5e5c325f6cb3ca9498581);
5014+
50075015
static int __init kprobe_hook_init(void)
50085016
{
50095017
int ret;
50105018

50115019
#if defined(MODULE)
5012-
printk(KERN_INFO "[ELKEID] loading kmod %s (%s).\n",
5013-
THIS_MODULE->name, THIS_MODULE->version);
5020+
printk(KERN_INFO "[ELKEID] kmod: %s (%s / %s) loaded\n",
5021+
THIS_MODULE->name, THIS_MODULE->version, THIS_MODULE->srcversion);
50145022
#endif
5023+
printk(KERN_INFO "[ELKEID] srcid: %s\n", smith_srcid);
50155024

50165025
ret = kernel_symbols_init();
50175026
if (ret)

0 commit comments

Comments
 (0)