Skip to content

Commit 1b2caa2

Browse files
committed
kdb: Remove the ll command
Recently some code inspection was done after fixing a problem with kmalloc used while in the kernel debugger context (which is not legal), and it turned up the fact that kdb ll command will oops the kernel. Given that there have been zero bug reports on the command combined with the fact it will oops the kernel it is clearly not being used. Instead of fixing it, it will be removed. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent 074604a commit 1b2caa2

File tree

1 file changed

+0
-65
lines changed

1 file changed

+0
-65
lines changed

kernel/debug/kdb/kdb_main.c

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,69 +2362,6 @@ static int kdb_pid(int argc, const char **argv)
23622362
return 0;
23632363
}
23642364

2365-
/*
2366-
* kdb_ll - This function implements the 'll' command which follows a
2367-
* linked list and executes an arbitrary command for each
2368-
* element.
2369-
*/
2370-
static int kdb_ll(int argc, const char **argv)
2371-
{
2372-
int diag = 0;
2373-
unsigned long addr;
2374-
long offset = 0;
2375-
unsigned long va;
2376-
unsigned long linkoffset;
2377-
int nextarg;
2378-
const char *command;
2379-
2380-
if (argc != 3)
2381-
return KDB_ARGCOUNT;
2382-
2383-
nextarg = 1;
2384-
diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL);
2385-
if (diag)
2386-
return diag;
2387-
2388-
diag = kdbgetularg(argv[2], &linkoffset);
2389-
if (diag)
2390-
return diag;
2391-
2392-
/*
2393-
* Using the starting address as
2394-
* the first element in the list, and assuming that
2395-
* the list ends with a null pointer.
2396-
*/
2397-
2398-
va = addr;
2399-
command = kdb_strdup(argv[3], GFP_KDB);
2400-
if (!command) {
2401-
kdb_printf("%s: cannot duplicate command\n", __func__);
2402-
return 0;
2403-
}
2404-
/* Recursive use of kdb_parse, do not use argv after this point */
2405-
argv = NULL;
2406-
2407-
while (va) {
2408-
char buf[80];
2409-
2410-
if (KDB_FLAG(CMD_INTERRUPT))
2411-
goto out;
2412-
2413-
sprintf(buf, "%s " kdb_machreg_fmt "\n", command, va);
2414-
diag = kdb_parse(buf);
2415-
if (diag)
2416-
goto out;
2417-
2418-
addr = va + linkoffset;
2419-
if (kdb_getword(&va, addr, sizeof(va)))
2420-
goto out;
2421-
}
2422-
2423-
out:
2424-
kfree(command);
2425-
return diag;
2426-
}
2427-
24282365
static int kdb_kgdb(int argc, const char **argv)
24292366
{
24302367
return KDB_CMD_KGDB;
@@ -2866,8 +2803,6 @@ static void __init kdb_inittab(void)
28662803
kdb_register_repeat("btt", kdb_bt, "<vaddr>",
28672804
"Backtrace process given its struct task address", 0,
28682805
KDB_REPEAT_NONE);
2869-
kdb_register_repeat("ll", kdb_ll, "<first-element> <linkoffset> <cmd>",
2870-
"Execute cmd for each element in linked list", 0, KDB_REPEAT_NONE);
28712806
kdb_register_repeat("env", kdb_env, "",
28722807
"Show environment variables", 0, KDB_REPEAT_NONE);
28732808
kdb_register_repeat("set", kdb_set, "",

0 commit comments

Comments
 (0)