public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Ball <Richard.Ball@arm.com>
To: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>,
	Richard Earnshaw <Richard.Earnshaw@arm.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] arm: Zero/Sign extends for CMSE security
Date: Thu, 25 Apr 2024 14:25:35 +0000	[thread overview]
Message-ID: <DB9PR08MB6957D114A42E47184EBEE28781172@DB9PR08MB6957.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <f15e849b-3e75-4df9-a3cd-6c3a9188be3a@foss.st.com>

[-- Attachment #1: Type: text/plain, Size: 1826 bytes --]

Hi Torbjorn,

Thanks very much for the comments.
I think given that the code that handles this, is within a FOREACH_FUNCTION_ARGS loop.
It seems a fairly safe assumption that if the code works for one that it will work for all.
To go back and add extra tests to me seems a little overkill.

Kind Regards,
Richard Ball
________________________________
From: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>
Sent: 25 April 2024 12:47
To: Richard Ball <Richard.Ball@arm.com>; gcc-patches@gcc.gnu.org <gcc-patches@gcc.gnu.org>; Richard Earnshaw <Richard.Earnshaw@arm.com>; Richard Sandiford <Richard.Sandiford@arm.com>; Marcus Shawcroft <Marcus.Shawcroft@arm.com>; Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
Subject: Re: [PATCH] arm: Zero/Sign extends for CMSE security

Hi,

On 2024-04-24 17:55, Richard Ball wrote:
> This patch makes the following changes:
>
> 1) When calling a secure function from non-secure code then any arguments
>     smaller than 32-bits that are passed in registers are zero- or sign-extended.
> 2) After a non-secure function returns into secure code then any return value
>     smaller than 32-bits that is passed in a register is  zero- or sign-extended.
>
> This patch addresses the following CVE-2024-0151.
>
> gcc/ChangeLog:
>          PR target/114837
>          * config/arm/arm.cc (cmse_nonsecure_call_inline_register_clear):
>            Add zero/sign extend.
>          (arm_expand_prologue): Add zero/sign extend.
>
> gcc/testsuite/ChangeLog:
>
>          * gcc.target/arm/cmse/extend-param.c: New test.
>          * gcc.target/arm/cmse/extend-return.c: New test.

I think it would make sense that there is at least one test case that
takes 2 or more arguments to ensure that not only the first argument is
extended. WDYT?


Kind regards,
Torbjörn

  reply	other threads:[~2024-04-25 14:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 15:55 Richard Ball
2024-04-25 10:01 ` Richard Earnshaw (lists)
2024-04-25 11:47 ` Torbjorn SVENSSON
2024-04-25 14:25   ` Richard Ball [this message]
2024-04-26  8:39     ` Torbjorn SVENSSON
2024-04-26  9:19       ` Richard Earnshaw (lists)
2024-04-27 14:13         ` [PATCH] testsuite: Verify r0-r3 are extended with CMSE Torbjörn SVENSSON
2024-04-30 15:11           ` Richard Earnshaw (lists)
2024-04-30 15:37             ` Torbjorn SVENSSON
2024-04-30 16:50               ` Richard Earnshaw (lists)
2024-05-02 10:50                 ` [PATCH v2] " Torbjörn SVENSSON
2024-05-06 11:50                   ` Torbjorn SVENSSON
2024-05-14 11:01                     ` [PING] " Torbjorn SVENSSON
2024-05-21 11:06                       ` [PING^2] " Torbjorn SVENSSON
2024-05-22 10:55                     ` Richard Earnshaw (lists)
2024-05-22 11:14                       ` Torbjorn SVENSSON
2024-05-22 11:54                         ` Richard Earnshaw (lists)
2024-05-22 19:49                           ` Torbjorn SVENSSON

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=DB9PR08MB6957D114A42E47184EBEE28781172@DB9PR08MB6957.eurprd08.prod.outlook.com \
    --to=richard.ball@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=torbjorn.svensson@foss.st.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).