[PATCH v2 0/3] hw_breakpoint: Save privilege of access control via ptrace

Tiezhu Yang posted 3 patches 1 year, 5 months ago
There is a newer version of this series
arch/arm/kernel/hw_breakpoint.c   |  4 +---
arch/arm/kernel/ptrace.c          |  2 ++
arch/arm64/kernel/hw_breakpoint.c | 11 ++---------
arch/arm64/kernel/ptrace.c        |  2 ++
include/uapi/linux/perf_event.h   |  3 +++
kernel/events/hw_breakpoint.c     |  1 +
6 files changed, 11 insertions(+), 12 deletions(-)
[PATCH v2 0/3] hw_breakpoint: Save privilege of access control via ptrace
Posted by Tiezhu Yang 1 year, 5 months ago
Hi all,

Thank you very much for your feedbacks in the v1 patch.
This series is based on 6.10-rc4, cross compile tested only.

As far as I can tell, these changes are not relevant with tools/perf,
on some archs such as ARM, ARM64 and LoongArch which have privilege
level of breakpoint, the initial aim is to make use of the value of
ctrl->privilege saved in decode_ctrl_reg() and then remove the check
whether bp virtual address is in kernel space to assign value for
hw->ctrl.privilege in arch_build_bp_info().

v2:
  -- Put the new member "bp_priv" at the end of the uapi
     struct perf_event_attr and add PERF_ATTR_SIZE_VER9.
  -- Update the commit message to make the goal clear.

Tiezhu Yang (3):
  perf: Add perf_event_attr::bp_priv
  arm: hw_breakpoint: Save privilege of access control via ptrace
  arm64: hw_breakpoint: Save privilege of access control via ptrace

 arch/arm/kernel/hw_breakpoint.c   |  4 +---
 arch/arm/kernel/ptrace.c          |  2 ++
 arch/arm64/kernel/hw_breakpoint.c | 11 ++---------
 arch/arm64/kernel/ptrace.c        |  2 ++
 include/uapi/linux/perf_event.h   |  3 +++
 kernel/events/hw_breakpoint.c     |  1 +
 6 files changed, 11 insertions(+), 12 deletions(-)

-- 
2.42.0
Re: [PATCH v2 0/3] hw_breakpoint: Save privilege of access control via ptrace
Posted by Tiezhu Yang 1 year, 5 months ago
On 6/21/24 15:39, Tiezhu Yang wrote:
> Hi all,
> 
> Thank you very much for your feedbacks in the v1 patch.
> This series is based on 6.10-rc4, cross compile tested only.
> 
> As far as I can tell, these changes are not relevant with tools/perf,
> on some archs such as ARM, ARM64 and LoongArch which have privilege
> level of breakpoint, the initial aim is to make use of the value of
> ctrl->privilege saved in decode_ctrl_reg() and then remove the check
> whether bp virtual address is in kernel space to assign value for
> hw->ctrl.privilege in arch_build_bp_info().
> 
> v2:
>    -- Put the new member "bp_priv" at the end of the uapi
>       struct perf_event_attr and add PERF_ATTR_SIZE_VER9.
>    -- Update the commit message to make the goal clear.
> 
> Tiezhu Yang (3):
>    perf: Add perf_event_attr::bp_priv
>    arm: hw_breakpoint: Save privilege of access control via ptrace
>    arm64: hw_breakpoint: Save privilege of access control via ptrace
> 
>   arch/arm/kernel/hw_breakpoint.c   |  4 +---
>   arch/arm/kernel/ptrace.c          |  2 ++
>   arch/arm64/kernel/hw_breakpoint.c | 11 ++---------
>   arch/arm64/kernel/ptrace.c        |  2 ++
>   include/uapi/linux/perf_event.h   |  3 +++
>   kernel/events/hw_breakpoint.c     |  1 +
>   6 files changed, 11 insertions(+), 12 deletions(-)

Ping, any more comments? Is it possible to merge this series
for the coming merge window?

If this patch series has no value and is not acceptable,
or what should I do to update, please let me know.

Thanks,
Tiezhu
Re: [PATCH v2 0/3] hw_breakpoint: Save privilege of access control via ptrace
Posted by Russell King (Oracle) 1 year, 5 months ago
On Thu, Jul 04, 2024 at 10:47:59PM +0800, Tiezhu Yang wrote:
> On 6/21/24 15:39, Tiezhu Yang wrote:
> > Hi all,
> > 
> > Thank you very much for your feedbacks in the v1 patch.
> > This series is based on 6.10-rc4, cross compile tested only.
> > 
> > As far as I can tell, these changes are not relevant with tools/perf,
> > on some archs such as ARM, ARM64 and LoongArch which have privilege
> > level of breakpoint, the initial aim is to make use of the value of
> > ctrl->privilege saved in decode_ctrl_reg() and then remove the check
> > whether bp virtual address is in kernel space to assign value for
> > hw->ctrl.privilege in arch_build_bp_info().
> > 
> > v2:
> >    -- Put the new member "bp_priv" at the end of the uapi
> >       struct perf_event_attr and add PERF_ATTR_SIZE_VER9.
> >    -- Update the commit message to make the goal clear.
> > 
> > Tiezhu Yang (3):
> >    perf: Add perf_event_attr::bp_priv
> >    arm: hw_breakpoint: Save privilege of access control via ptrace
> >    arm64: hw_breakpoint: Save privilege of access control via ptrace
> > 
> >   arch/arm/kernel/hw_breakpoint.c   |  4 +---
> >   arch/arm/kernel/ptrace.c          |  2 ++
> >   arch/arm64/kernel/hw_breakpoint.c | 11 ++---------
> >   arch/arm64/kernel/ptrace.c        |  2 ++
> >   include/uapi/linux/perf_event.h   |  3 +++
> >   kernel/events/hw_breakpoint.c     |  1 +
> >   6 files changed, 11 insertions(+), 12 deletions(-)
> 
> Ping, any more comments? Is it possible to merge this series
> for the coming merge window?

Maybe someone who knows the perf stuff can review it and give an
opinion?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!