From: "H. Peter Anvin" <hpa@zytor.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org
Subject: Re: [PATCH] x86: Fix 32-bit compatible userspace write size overflow error
Date: Wed, 15 Nov 2023 20:31:20 -0800 [thread overview]
Message-ID: <76da1bcd-0d00-4701-8f6f-cc28b5184bce@zytor.com> (raw)
In-Reply-To: <20231115105626.953273-1-ruanjinjie@huawei.com>
It's not clear to me that this is actually the correct behavior; the
important thing is that it faults (as nothing is mapped above 4 GB anyway.)
-hpa
On 11/15/23 02:56, Jinjie Ruan wrote:
> For 32-bit compatible userspace program, write with size = -1 return not
> -1 but unexpected other values, which is due to the __access_ok() check is
> insufficient. The specified "ptr + size" is greater than 32-bit limit and
> should return -EFAULT, but it is not checked and can not catch the overflow
> error.
>
> Fix above error by checking 32-bit limit if it is 32-bit compatible
> userspace program.
-hpa
prev parent reply other threads:[~2023-11-16 4:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 10:56 Jinjie Ruan
2023-11-16 4:31 ` H. Peter Anvin [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=76da1bcd-0d00-4701-8f6f-cc28b5184bce@zytor.com \
--to=hpa@zytor.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=ruanjinjie@huawei.com \
--cc=tglx@linutronix.de \
--cc=x86@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
all inboxes | Powered by JetHome®