All of lore.kernel.org
 help / color / mirror / Atom feed
From: jeff.xie@linux.dev
To: "Thomas Gleixner" <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, xiehuan09@gmail.com
Subject: Re: [PATCH v2] genirq: procfs: Make smp_affinity read-only for interrupts that userspace can't set
Date: Mon, 26 Aug 2024 11:27:01 +0000	[thread overview]
Message-ID: <93bfdd5f320ebd62087b932ba9c227cff60ab60e@linux.dev> (raw)
In-Reply-To: <87seurd057.ffs@tglx>

August 26, 2024 at 6:55 PM, "Thomas Gleixner" <tglx@linutronix.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@linux.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
>

  reply	other threads:[~2024-08-26 11:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-25 13:19 [PATCH v2] genirq: procfs: Make smp_affinity read-only for interrupts that userspace can't set Jeff Xie
2024-08-26 10:55 ` Thomas Gleixner
2024-08-26 11:27   ` jeff.xie [this message]
2024-08-26 12:09 ` [tip: irq/core] genirq/procfs: Correctly set file permissions for affinity control files tip-bot2 for Jeff Xie
2024-08-27  6:22 ` [PATCH v2] genirq: procfs: Make smp_affinity read-only for interrupts that userspace can't set kernel test robot
2024-08-27 10:20 ` [tip: irq/core] genirq/procfs: Correctly set file permissions for affinity control files tip-bot2 for Jeff Xie
2024-08-27 12:02 ` tip-bot2 for Jeff Xie
2024-08-29 14:46 ` [tip: irq/core] genirq/proc: " tip-bot2 for Jeff Xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93bfdd5f320ebd62087b932ba9c227cff60ab60e@linux.dev \
    --to=jeff.xie@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=xiehuan09@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.