1
0

Implements KPTI flag

This commit is contained in:
2019-08-20 00:05:19 +00:00
parent 24b2123582
commit a08861cc19
5 changed files with 39 additions and 12 deletions

View File

@ -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, ":")