From: Florian Bezdeka <florian.bezdeka@siemens.com>
To: Johannes Kirchmair <johannes.kirchmair@sigmatek.at>,
xenomai@lists.linux.dev
Subject: Re: [PATCH] add dovtail signal setup function
Date: Wed, 16 Aug 2023 12:39:58 +0200 [thread overview]
Message-ID: <e04ac9487b616adb751e6c7a19850a317cda153c.camel@siemens.com> (raw)
In-Reply-To: <20230816101853.3377721-1-johannes.kirchmair@sigmatek.at>
On Wed, 2023-08-16 at 12:18 +0200, Johannes Kirchmair wrote:
> +int dovetail_restore_64_rt_signal_frame(struct pt_regs *regs)
> +{
> + struct rt_sigframe __user *frame;
> + unsigned long uc_flags;
> +
> + frame = (struct rt_sigframe __user *)(regs->sp - sizeof(long));
> + if (!access_ok(frame, sizeof(*frame)))
> + return -1;
> + if (__get_user(uc_flags, &frame->uc.uc_flags))
> + return -1;
> +
> + if (!restore_sigcontext(regs, &frame->uc.uc_mcontext, uc_flags))
> + return -1;
> +
> + return 0;
> +}
> +
Just a drive-by comment, didn't check all the details yet:
Instead of returning -1 the underlying error (= return the return value
of the function calls) should be reported and/or use proper error
"codes" such as -EINVAL or -EFAULT.
Florian
next prev parent reply other threads:[~2023-08-16 10:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 10:18 [PATCH] add dovtail signal setup function Johannes Kirchmair
2023-08-16 10:24 ` Johannes Kirchmair
2023-08-16 10:33 ` Jan Kiszka
2023-08-16 10:39 ` Florian Bezdeka [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-05-09 13:11 Johannes Kirchmair
2023-08-14 17:33 ` Jan Kiszka
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=e04ac9487b616adb751e6c7a19850a317cda153c.camel@siemens.com \
--to=florian.bezdeka@siemens.com \
--cc=johannes.kirchmair@sigmatek.at \
--cc=xenomai@lists.linux.dev \
/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).