Re: apmd(8) and hw.perfpolicy quirks

2020-09-23 Thread Ted Unangst
On 2020-09-23, Jeremie Courreges-Anglas wrote: > ok? Seems fine. > Note: I inlined the apmd(8)->apm(8) perfpolicy conversion for now, which > brings a question. I find it weird that there is a special "high" > perfpolicy (effectively similar to perfpolicy=manual + setperf=100) but > no "low"

Re: uvm_map_inentry() checks in trap()

2020-09-23 Thread Theo de Raadt
Theo de Raadt wrote: > kettenis, mortimer, and I have had long discussions about the > uvm_map_inentry() checks in MD trap.c being excessively broad. We can > this check-function less often. > > I don't want to explain the full picture about how SP and PC checks > in syscall() and trap()

Re: uvm_map_inentry() checks in trap()

2020-09-23 Thread Theo de Raadt
Theo de Raadt wrote: > Theo de Raadt wrote: > > > kettenis, mortimer, and I have had long discussions about the > > uvm_map_inentry() checks in MD trap.c being excessively broad. We can > > this check-function less often. > > > > I don't want to explain the full picture about how SP and PC

Re: uvm_map_inentry() checks in trap()

2020-09-23 Thread Theo de Raadt
Theo de Raadt wrote: > kettenis, mortimer, and I have had long discussions about the > uvm_map_inentry() checks in MD trap.c being excessively broad. We can > this check-function less often. > > I don't want to explain the full picture about how SP and PC checks > in syscall() and trap()

uvm_map_inentry() checks in trap()

2020-09-23 Thread Theo de Raadt
kettenis, mortimer, and I have had long discussions about the uvm_map_inentry() checks in MD trap.c being excessively broad. We can this check-function less often. I don't want to explain the full picture about how SP and PC checks in syscall() and trap() hinder ROP, ROP stack pivoting, gadgets

Re: apmd(8) and hw.perfpolicy quirks

2020-09-23 Thread Jeremie Courreges-Anglas
On Wed, Sep 23 2020, Jeremie Courreges-Anglas wrote: > Prompted by a report from Miod: setting hw.setperf works only if the > kernel doesn't have a usable cpu_setperf implementation. The current > apmd(8) code warns if setting hw.perfpolicy fails, but then handles > back bogus values to apm(8)

apmd(8) and hw.perfpolicy quirks

2020-09-23 Thread Jeremie Courreges-Anglas
Prompted by a report from Miod: setting hw.setperf works only if the kernel doesn't have a usable cpu_setperf implementation. The current apmd(8) code warns if setting hw.perfpolicy fails, but then handles back bogus values to apm(8) clients. The easy fix is to just query the kernel about the