public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@tilera.com>
To: Will Deacon <will.deacon@arm.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-arch@vger.kernel.org>,
	<davem@davemloft.net>, <chris@zankel.net>,
	<catalin.marinas@arm.com>, <arnd@arndb.de>,
	<akpm@linux-foundation.org>
Subject: Re: [PATCH 3/3] ipc: compat: use signed size_t types for msgsnd and msgrcv
Date: Wed, 11 Jul 2012 12:06:55 -0400	[thread overview]
Message-ID: <4FFDA49F.4070500@tilera.com> (raw)
In-Reply-To: <1342020741-12758-4-git-send-email-will.deacon@arm.com>

On 7/11/2012 11:32 AM, Will Deacon wrote:
> The msgsnd and msgrcv system calls use size_t to represent the size of
> the message being transferred. POSIX states that values of msgsz greater
> than SSIZE_MAX cause the result to be implementation-defined. On Linux,
> this equates to returning -EINVAL if (long) msgsz < 0.
>
> For compat tasks where !CONFIG_ARCH_WANT_OLD_COMPAT_IPC and
> compat_size_t is smaller than size_t, negative size values passed from
> userspace will be interpreted as positive values by do_msg{rcv,snd} and
> will fail to exit early with -EINVAL.
>
> This patch changes the compat prototypes for msg{rcv,snd} so that the
> message size is represented as a compat_ssize_t, which we cast to the
> native ssize_t type for the core IPC code.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
>  include/linux/compat.h |    4 ++--
>  ipc/compat.c           |    8 ++++----
>  2 files changed, 6 insertions(+), 6 deletions(-)

Acked-by: Chris Metcalf <cmetcalf@tilera.com>

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com




      reply	other threads:[~2012-07-11 16:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 15:32 [PATCH 0/3] random compat IPC fixes required by AArch64 Will Deacon
2012-07-11 15:32 ` [PATCH 1/3] ipc: add COMPAT_SHMLBA support Will Deacon
2012-07-11 15:32 ` [PATCH 2/3] ipc: allow compat IPC version field parsing if !ARCH_WANT_OLD_COMPAT_IPC Will Deacon
2012-07-11 16:07   ` Chris Metcalf
2012-07-11 21:40   ` Andrew Morton
2012-07-12  8:47     ` Will Deacon
2012-07-12  8:59       ` Andrew Morton
2012-07-13 10:39         ` Will Deacon
2012-07-11 15:32 ` [PATCH 3/3] ipc: compat: use signed size_t types for msgsnd and msgrcv Will Deacon
2012-07-11 16:06   ` Chris Metcalf [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=4FFDA49F.4070500@tilera.com \
    --to=cmetcalf@tilera.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=chris@zankel.net \
    --cc=davem@davemloft.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will.deacon@arm.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