Implements KPTI flag
This commit is contained in:
@ -75,6 +75,7 @@ type System struct {
|
||||
noKASLR bool
|
||||
noSMEP bool
|
||||
noSMAP bool
|
||||
noKPTI bool
|
||||
|
||||
// Timeout works after Start invocation
|
||||
Timeout time.Duration
|
||||
@ -202,6 +203,10 @@ func (q System) cmdline() (s string) {
|
||||
s += " nosmap"
|
||||
}
|
||||
|
||||
if q.noKPTI {
|
||||
s += " nokpti"
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@ -402,6 +407,11 @@ func (q *System) SetSMAP(state bool) {
|
||||
q.noSMAP = !state
|
||||
}
|
||||
|
||||
// SetKPTI is changing KPTI state through kernel boot args
|
||||
func (q *System) SetKPTI(state bool) {
|
||||
q.noKPTI = !state
|
||||
}
|
||||
|
||||
// GetKASLR is retrieve KASLR settings
|
||||
func (q *System) GetKASLR() bool {
|
||||
return !q.noKASLR
|
||||
@ -417,6 +427,11 @@ func (q *System) GetSMAP() bool {
|
||||
return !q.noSMAP
|
||||
}
|
||||
|
||||
// GetKPTI is retrieve KPTI settings
|
||||
func (q *System) GetKPTI() bool {
|
||||
return !q.noKPTI
|
||||
}
|
||||
|
||||
// GetSSHCommand returns command for connect to qemu machine over ssh
|
||||
func (q System) GetSSHCommand() (cmd string) {
|
||||
addrPort := strings.Split(q.sshAddrPort, ":")
|
||||
|
Reference in New Issue
Block a user