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] [day] [month] [year] [list]
Message-ID: <CADBMgpxiQMGZpdqxc5ejeuhowUVNWiDqx=BVmRQEWxkn1+WXHA@mail.gmail.com>
Date: Thu, 22 May 2025 13:01:58 -0700
From: Dylan Hatch <dylanbhatch@...gle.com>
To: Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>, 
	Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org, 
	"H. Peter Anvin" <hpa@...or.com>, Josh Poimboeuf <jpoimboe@...nel.org>, Jiri Kosina <jikos@...nel.org>, 
	Miroslav Benes <mbenes@...e.cz>, Petr Mladek <pmladek@...e.com>, 
	Joe Lawrence <joe.lawrence@...hat.com>
Cc: Song Liu <song@...nel.org>, Ard Biesheuvel <ardb@...nel.org>, 
	Sami Tolvanen <samitolvanen@...gle.com>, Peter Zijlstra <peterz@...radead.org>, 
	"Mike Rapoport (Microsoft)" <rppt@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>, 
	Dan Carpenter <dan.carpenter@...aro.org>, linux-arm-kernel@...ts.infradead.org, 
	linux-kernel@...r.kernel.org, live-patching@...r.kernel.org
Subject: Re: [PATCH v3 2/2] arm64/module: Use text-poke API for late relocations.

On Thu, May 22, 2025 at 11:43 AM Dylan Hatch <dylanbhatch@...gle.com> wrote:
> -static int reloc_data(enum aarch64_reloc_op op, void *place, u64 val, int len)
> +static int reloc_data(enum aarch64_reloc_op op, void *place, u64 val, int len,
> +                     struct module *me)
>  {
>         s64 sval = do_reloc(op, place, val);
>
> @@ -66,7 +69,11 @@ static int reloc_data(enum aarch64_reloc_op op, void *place, u64 val, int len)
>
>         switch (len) {
>         case 16:
> -               *(s16 *)place = sval;
> +               if (me->state != MODULE_STATE_UNFORMED)
> +                       aarch64_insn_set(place, sval, sizeof(s16));
> +               else
> +                       *(s16 *)place = sval;
> +
>                 switch (op) {
>                 case RELOC_OP_ABS:
>                         if (sval < 0 || sval > U16_MAX)
> @@ -82,7 +89,11 @@ static int reloc_data(enum aarch64_reloc_op op, void *place, u64 val, int len)
>                 }
>                 break;
>         case 32:
> -               *(s32 *)place = sval;
> +               if (me->state != MODULE_STATE_UNFORMED)
> +                       aarch64_insn_set(place, sval, sizeof(s32));
> +               else
> +                       *(s32 *)place = sval;
> +
>                 switch (op) {
>                 case RELOC_OP_ABS:
>                         if (sval < 0 || sval > U32_MAX)
> @@ -98,8 +109,10 @@ static int reloc_data(enum aarch64_reloc_op op, void *place, u64 val, int len)
>                 }
>                 break;
>         case 64:
> -               *(s64 *)place = sval;
> -               break;
> +               if (me->state != MODULE_STATE_UNFORMED)
> +                       aarch64_insn_set(place, sval, sizeof(s64));
> +               else
> +                       *(s64 *)place = sval;           break;
>         default:
>                 pr_err("Invalid length (%d) for data relocation\n", len);
>                 return 0;
> @@ -113,7 +126,8 @@ enum aarch64_insn_movw_imm_type {
>  };

Don't merge this. I spotted an issue -- for the data relocations this
looks like an incorrect usage of aarch64_insn_set(). An updated
version will follow soon.

Thanks,
Dylan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ