lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <93bfdd5f320ebd62087b932ba9c227cff60ab60e@linux.dev>
Date: Mon, 26 Aug 2024 11:27:01 +0000
From: jeff.xie@...ux.dev
To: "Thomas Gleixner" <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org, xiehuan09@...il.com
Subject: Re: [PATCH v2] genirq: procfs: Make smp_affinity read-only for
 interrupts that userspace can't set

August 26, 2024 at 6:55 PM, "Thomas Gleixner" <tglx@...utronix.de> wrote:



> 
> On Sun, Aug 25 2024 at 21:19, Jeff Xie wrote:
> 
> > 
> > The kernel already knows at the time of interrupt allocation that the
> > 
> >  affinity cannot be controlled by userspace and therefore creating the
> > 
> >  file with write permissions is wrong.
> > 
> >  Therefore set the file permissions to read-only for such interrupts.
> > 
> >  Signed-off-by: Jeff Xie <jeff.xie@...ux.dev>
> > 
> >  ---
> > 
> >  v2:
> > 
> >  - Updated the description suggested by tglx
> > 
> >  - Corrected the return value from -EIO to -EPERM when the userspace can't set the affinity
> > 
> >  kernel/irq/proc.c | 10 +++++++---
> > 
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> > 
> >  diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
> > 
> >  index 8cccdf40725a..7b3a4c92d148 100644
> > 
> >  --- a/kernel/irq/proc.c
> > 
> >  +++ b/kernel/irq/proc.c
> > 
> >  @@ -142,7 +142,7 @@ static ssize_t write_irq_affinity(int type, struct file *file,
> > 
> >  int err;
> > 
> >  
> > 
> >  if (!irq_can_set_affinity_usr(irq) || no_irq_affinity)
> > 
> >  - return -EIO;
> > 
> >  + return -EPERM;
> > 
> 
> I drop this hunk as it is unrelated to $subject. That want's to be a
> 
> separate patch. Documentation/process clearly states:
> 
>  Solve only one problem per patch.

Thank you for the reminder. I overlooked that single line change, which is indeed unrelated to the subject. I'll send it as a separate patch.

> Thanks,
> 
>  tglx
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ