mac: add new mac_ddb(4) policyGenerally, access to the kernel debugger is considered to be unsafe froma security perspective since it presents an unrestricted interface toinspect or modify the sy
mac: add new mac_ddb(4) policyGenerally, access to the kernel debugger is considered to be unsafe froma security perspective since it presents an unrestricted interface toinspect or modify the system state, including sensitive data such assigning keys.However, having some access to debugger functionality on productionsystems may be useful in determining the cause of a panic or hang.Therefore, it is desirable to have an optional policy which allowslimited use of ddb(4) while disabling the functionality which couldreveal system secrets.This loadable MAC module allows for the use of some ddb(4) commandswhile preventing the execution of others. The commands have been broadlygrouped into three categories: - Those which are 'safe' and will not emit sensitive data (e.g. trace). Generally, these commands are deterministic and don't accept arguments. - Those which are definitively unsafe (e.g. examine <addr>, search <addr> <value>) - Commands which may be safe to execute depending on the arguments provided (e.g. show thread <addr>).Safe commands have been flagged as such with the DB_CMD_MEMSAFE flag.Commands requiring extra validation can provide a function to do so.For example, 'show thread <addr>' can be used as long as addr can bechecked against the system's list of process structures.The policy also prevents debugger backends other than ddb(4) fromexecuting, for example gdb(4).Reviewed by: markj, pauamma_gundo.com (manpages)Sponsored by: Juniper Networks, Inc.Sponsored by: Klara, Inc.Differential Revision: https://reviews.freebsd.org/D35371
show more ...