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 'kgdb-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux

Pull kgdb updates from Daniel Thompson:
"Pretty quiet this cycle. Just a couple of small fixes from myself both
of which were reviewed by Doug Anderson to keep me honest (thanks)"

* tag 'kgdb-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux:
kdb: Censor attempts to set PROMPT without ENABLE_MEM_READ
kdb: Eliminate strncpy() warnings by replacing with strscpy()

+12 -8
+12 -8
kernel/debug/kdb/kdb_main.c
··· 399 399 return KDB_ARGCOUNT; 400 400 401 401 /* 402 + * Censor sensitive variables 403 + */ 404 + if (strcmp(argv[1], "PROMPT") == 0 && 405 + !kdb_check_flags(KDB_ENABLE_MEM_READ, kdb_cmd_enabled, false)) 406 + return KDB_NOPERM; 407 + 408 + /* 402 409 * Check for internal variables 403 410 */ 404 411 if (strcmp(argv[1], "KDBDEBUG") == 0) { ··· 1109 1102 case CTRL_P: 1110 1103 if (cmdptr != cmd_tail) 1111 1104 cmdptr = (cmdptr-1) % KDB_CMD_HISTORY_COUNT; 1112 - strncpy(cmd_cur, cmd_hist[cmdptr], CMD_BUFLEN); 1105 + strscpy(cmd_cur, cmd_hist[cmdptr], CMD_BUFLEN); 1113 1106 return 1; 1114 1107 case CTRL_N: 1115 1108 if (cmdptr != cmd_head) 1116 1109 cmdptr = (cmdptr+1) % KDB_CMD_HISTORY_COUNT; 1117 - strncpy(cmd_cur, cmd_hist[cmdptr], CMD_BUFLEN); 1110 + strscpy(cmd_cur, cmd_hist[cmdptr], CMD_BUFLEN); 1118 1111 return 1; 1119 1112 } 1120 1113 return 0; ··· 1305 1298 *(cmd_hist[cmd_head]) = '\0'; 1306 1299 1307 1300 do_full_getstr: 1308 - #if defined(CONFIG_SMP) 1301 + /* PROMPT can only be set if we have MEM_READ permission. */ 1309 1302 snprintf(kdb_prompt_str, CMD_BUFLEN, kdbgetenv("PROMPT"), 1310 1303 raw_smp_processor_id()); 1311 - #else 1312 - snprintf(kdb_prompt_str, CMD_BUFLEN, kdbgetenv("PROMPT")); 1313 - #endif 1314 1304 if (defcmd_in_progress) 1315 1305 strncat(kdb_prompt_str, "[defcmd]", CMD_BUFLEN); 1316 1306 ··· 1318 1314 if (*cmdbuf != '\n') { 1319 1315 if (*cmdbuf < 32) { 1320 1316 if (cmdptr == cmd_head) { 1321 - strncpy(cmd_hist[cmd_head], cmd_cur, 1317 + strscpy(cmd_hist[cmd_head], cmd_cur, 1322 1318 CMD_BUFLEN); 1323 1319 *(cmd_hist[cmd_head] + 1324 1320 strlen(cmd_hist[cmd_head])-1) = '\0'; ··· 1328 1324 cmdbuf = cmd_cur; 1329 1325 goto do_full_getstr; 1330 1326 } else { 1331 - strncpy(cmd_hist[cmd_head], cmd_cur, 1327 + strscpy(cmd_hist[cmd_head], cmd_cur, 1332 1328 CMD_BUFLEN); 1333 1329 } 1334 1330