Skip to content

Commit

Permalink
fix: properly read kexec disabled sysctl
Browse files Browse the repository at this point in the history
Fixes #6046

Fix by @bzub

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Aug 23, 2022
1 parent cfe6c2b commit 361e85b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func SetRLimit(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFun
// DropCapabilities drops some capabilities so that they can't be restored by child processes.
func DropCapabilities(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string) {
return func(ctx context.Context, logger *log.Logger, r runtime.Runtime) error {
prop, err := krnl.ReadParam(&kernel.Param{Key: "kernel.kexec_load_disabled"})
prop, err := krnl.ReadParam(&kernel.Param{Key: "proc.sys.kernel.kexec_load_disabled"})
if v := strings.TrimSpace(string(prop)); err == nil && v != "0" {
logger.Printf("kernel.kexec_load_disabled is %v, skipping dropping capabilities", v)

Expand Down

0 comments on commit 361e85b

Please sign in to comment.