Skip to content

Commit 977f395

Browse files
author
bmax
committedDec 31, 2023
fix: kpm user interface
1 parent b0a990f commit 977f395

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed
 

‎kernel/patch/common/supercall.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,15 @@ static long call_kpm_info(const char *__user uname, char *__user out_info, int o
8989
{
9090
if (out_len <= 0) return -EINVAL;
9191
char name[64];
92-
char buf[1024];
92+
char buf[2048];
9393
int len = strncpy_from_user_nofault(name, uname, sizeof(name));
9494
if (len <= 0) return -EINVAL;
9595
int sz = get_module_info(name, buf, sizeof(buf));
96-
if (sz <= 0) return sz;
97-
if (sz > out_len) return -ENOMEM;
96+
if (sz < 0) return sz;
97+
if (sz > out_len) return -ENOBUFS;
9898
sz = seq_copy_to_user(out_info, buf, sz);
99-
return sz;
99+
if (sz < 0) return sz;
100+
return 0;
100101
}
101102

102103
static long call_su(struct su_profile *__user uprofile)

‎kernel/patch/module/module.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,10 @@ int get_module_info(const char *name, char *out_info, int size)
578578
"version=%s\n"
579579
"license=%s\n"
580580
"author=%s\n"
581-
"description=%s\n",
582-
mod->info.name, mod->info.version, mod->info.license, mod->info.author, mod->info.description);
581+
"description=%s\n"
582+
"args=%s\n",
583+
mod->info.name, mod->info.version, mod->info.license, mod->info.author, mod->info.description,
584+
mod->args);
583585
logkfd("%s", out_info);
584586
return sz;
585587
}

‎user/kpm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int kpm_list(const char *key)
3939

4040
int kpm_info(const char *key, const char *name)
4141
{
42-
char buf[1024];
42+
char buf[2048];
4343
int rc = sc_kpm_info(key, name, buf, sizeof(buf));
4444
if (rc > 0) {
4545
fprintf(stdout, "%s", buf);

‎version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#define MAJOR 0
22
#define MINOR 7
3-
#define PATCH 1
3+
#define PATCH 2

0 commit comments

Comments
 (0)
Please sign in to comment.