From: Dave Hansen <dave.hansen@intel.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch v2] x86_64, traps: always true condition
Date: Thu, 04 Dec 2014 21:56:56 +0000 [thread overview]
Message-ID: <5480D8A8.3050003@intel.com> (raw)
In-Reply-To: <20141125172114.GA24535@mwanda>
On 11/25/2014 09:21 AM, Dan Carpenter wrote:
> We should be checking IS_ERR() here. PTR_ERR() is always true.
>
> Fixes: fe3d197f8431 ('x86, mpx: On-demand kernel allocation of bounds
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: Use correct fixes tag.
>
> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index 67d817e..f176d96 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -331,7 +331,7 @@ dotraplinkage void do_bounds(struct pt_regs >
break; /* Success, it was handled */
> case 1: /* Bound violation. */
> info = mpx_generate_siginfo(regs, xsave_buf);
> - if (PTR_ERR(info)) {
> + if (IS_ERR(info)) {
> /*
> * We failed to decode the MPX instruction.
> * the exception was not caused by MPX.
I checked that this works on real hardware. The si_addr field in the
generated siginfo was empty without this patch applied. With this
patch, it has good (looking at least) contents.
Thanks for catching this!
Tested-by: Dave Hansen <dave.hansen@intel.com>
prev parent reply other threads:[~2014-12-04 21:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-25 17:21 [patch v2] x86_64, traps: always true condition Dan Carpenter
2014-12-04 21:33 ` Dave Hansen
2014-12-04 21:56 ` Dave Hansen [this message]
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=5480D8A8.3050003@intel.com \
--to=dave.hansen@intel.com \
--cc=kernel-janitors@vger.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 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 NNTP newsgroup(s).