All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andrew Jeffery" <andrew@aj.id.au>
To: "Kees Cook" <keescook@chromium.org>
Cc: linux-arm-kernel@lists.infradead.org,
	"Russell King" <linux@armlinux.org.uk>,
	mhiramat@kernel.org, labbott@redhat.com,
	mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: kprobes: Avoid fortify_panic() when copying optprobe template
Date: Mon, 18 May 2020 10:19:45 +0930	[thread overview]
Message-ID: <8a30fb45-779d-4459-984b-f7792858c92e@www.fastmail.com> (raw)
In-Reply-To: <202005171447.00CFE0C@keescook>



On Mon, 18 May 2020, at 07:18, Kees Cook wrote:
> On Mon, May 18, 2020 at 01:09:59AM +0930, Andrew Jeffery wrote:
> > As mentioned, a couple of attempts have been made to address the issue
> > by casting a pointer to optprobe_template_entry before providing it to
> > memcpy(), however gccs such as Ubuntu 20.04's arm-linux-gnueabi-gcc
> > 9.3.0 (Ubuntu 9.3.0-10ubuntu1) see through these efforts.
> 
> Ah, dang. :P
> 
> How about converting them all to unsized arrays, which would also allow
> the code to drop the "&" everywhere, I think. This is untested:

Looks better than my hack. Took it for a spin under qemu and it works for me.

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Tested-by: Andrew Jeffery <andrew@aj.id.au>

Thanks Kees!

Andrew

WARNING: multiple messages have this Message-ID (diff)
From: "Andrew Jeffery" <andrew@aj.id.au>
To: "Kees Cook" <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org,
	Russell King <linux@armlinux.org.uk>,
	mathieu.desnoyers@efficios.com, mhiramat@kernel.org,
	labbott@redhat.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: kprobes: Avoid fortify_panic() when copying optprobe template
Date: Mon, 18 May 2020 10:19:45 +0930	[thread overview]
Message-ID: <8a30fb45-779d-4459-984b-f7792858c92e@www.fastmail.com> (raw)
In-Reply-To: <202005171447.00CFE0C@keescook>



On Mon, 18 May 2020, at 07:18, Kees Cook wrote:
> On Mon, May 18, 2020 at 01:09:59AM +0930, Andrew Jeffery wrote:
> > As mentioned, a couple of attempts have been made to address the issue
> > by casting a pointer to optprobe_template_entry before providing it to
> > memcpy(), however gccs such as Ubuntu 20.04's arm-linux-gnueabi-gcc
> > 9.3.0 (Ubuntu 9.3.0-10ubuntu1) see through these efforts.
> 
> Ah, dang. :P
> 
> How about converting them all to unsized arrays, which would also allow
> the code to drop the "&" everywhere, I think. This is untested:

Looks better than my hack. Took it for a spin under qemu and it works for me.

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Tested-by: Andrew Jeffery <andrew@aj.id.au>

Thanks Kees!

Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-05-18  0:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 15:39 [PATCH] ARM: kprobes: Avoid fortify_panic() when copying optprobe template Andrew Jeffery
2020-05-17 15:39 ` Andrew Jeffery
2020-05-17 16:02 ` Russell King - ARM Linux admin
2020-05-17 16:02   ` Russell King - ARM Linux admin
2020-05-18  8:10   ` Andrew Jeffery
2020-05-18  8:10     ` Andrew Jeffery
2020-05-17 21:48 ` Kees Cook
2020-05-17 21:48   ` Kees Cook
2020-05-18  0:49   ` Andrew Jeffery [this message]
2020-05-18  0:49     ` Andrew Jeffery
2020-05-18  2:20   ` Masami Hiramatsu
2020-05-18  2:20     ` Masami Hiramatsu
2020-05-19  0:22     ` Andrew Jeffery
2020-05-19  0:22       ` Andrew Jeffery

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=8a30fb45-779d-4459-984b-f7792858c92e@www.fastmail.com \
    --to=andrew@aj.id.au \
    --cc=keescook@chromium.org \
    --cc=labbott@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    /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.