mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Thorsten Blum <thorsten.blum@linux.dev>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Naveen N Rao <naveen@kernel.org>,
	"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/mm/fault: Use str_write_read() helper function
Date: Mon, 10 Feb 2025 13:53:48 +0100	[thread overview]
Message-ID: <8ddc01a2-80b1-4283-a402-7f7c58c075c8@csgroup.eu> (raw)
In-Reply-To: <20250210100648.1440-2-thorsten.blum@linux.dev>



Le 10/02/2025 à 11:06, Thorsten Blum a écrit :
> Remove hard-coded strings by using the str_write_read() helper function.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>


Not sure you saw it, there's also one in:

linus/master:arch/powerpc/platforms/ps3/device-init.c:727:  const char 
*op = write ? "write" : "read";

> ---
>   arch/powerpc/mm/fault.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
> index c156fe0d53c3..806c74e0d5ab 100644
> --- a/arch/powerpc/mm/fault.c
> +++ b/arch/powerpc/mm/fault.c
> @@ -17,6 +17,7 @@
>   #include <linux/kernel.h>
>   #include <linux/errno.h>
>   #include <linux/string.h>
> +#include <linux/string_choices.h>
>   #include <linux/types.h>
>   #include <linux/pagemap.h>
>   #include <linux/ptrace.h>
> @@ -218,7 +219,7 @@ static bool bad_kernel_fault(struct pt_regs *regs, unsigned long error_code,
>   	// Read/write fault blocked by KUAP is bad, it can never succeed.
>   	if (bad_kuap_fault(regs, address, is_write)) {
>   		pr_crit_ratelimited("Kernel attempted to %s user page (%lx) - exploit attempt? (uid: %d)\n",
> -				    is_write ? "write" : "read", address,
> +				    str_write_read(is_write), address,
>   				    from_kuid(&init_user_ns, current_uid()));
>   
>   		// Fault on user outside of certain regions (eg. copy_tofrom_user()) is bad
> @@ -625,7 +626,7 @@ static void __bad_page_fault(struct pt_regs *regs, int sig)
>   	case INTERRUPT_DATA_STORAGE:
>   	case INTERRUPT_H_DATA_STORAGE:
>   		pr_alert("BUG: %s on %s at 0x%08lx\n", msg,
> -			 is_write ? "write" : "read", regs->dar);
> +			 str_write_read(is_write), regs->dar);
>   		break;
>   	case INTERRUPT_DATA_SEGMENT:
>   		pr_alert("BUG: %s at 0x%08lx\n", msg, regs->dar);


  reply	other threads:[~2025-02-10 13:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 10:06 Thorsten Blum
2025-02-10 12:53 ` Christophe Leroy [this message]
2025-05-18  3:44 ` Madhavan Srinivasan

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=8ddc01a2-80b1-4283-a402-7f7c58c075c8@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=ritesh.list@gmail.com \
    --cc=thorsten.blum@linux.dev \
    --cc=wangkefeng.wang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®