mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries Brouwer <aebr@win.tue.nl>
To: "Makhlis, Lev" <Lev_Makhlis@bmc.com>
Cc: "'Andries Brouwer'" <aebr@win.tue.nl>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [SYSVIPC] Change shm_tot from int to size_t
Date: Fri, 25 Jun 2004 22:39:14 +0200	[thread overview]
Message-ID: <20040625203914.GA5504@pclin040.win.tue.nl> (raw)
In-Reply-To: <F12B6443B4A38748AFA644D1F8EF3532147332@bos-ex-01.adprod.bmc.com>

On Fri, Jun 25, 2004 at 12:42:26PM -0500, Makhlis, Lev wrote:

> > Thirdly, shm_tot is transmitted to userspace (via the SHM_INFO ioctl)
> > as an unsigned long. If it is necessary to make it larger, then we
> > must do something with this ioctl. For example, return -1 there
> > in case the actual value does not fit in an unsigned long.
> 
> The SHM_INFO shmctl is actually how I found it in the first place.
> But we have the same situation with many other values.  For example,
> shm_ctlmax, shm_ctlall and shm_segsz can all potentially be 64-bit wide
> in the kernel and are exported into potentially 32-bit userspace values.
> We don't return -1 for any of those if they don't fit.  Is there a
> special reason to do it in this case?

There is a good reason to do it always.
If one truncates, then the result is always unreliable.
If one replaces a too large value by -1, then any other value is reliable.

  reply	other threads:[~2004-06-25 20:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-25 17:42 Makhlis, Lev
2004-06-25 20:39 ` Andries Brouwer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-06-28 16:22 Makhlis, Lev
2004-06-25 21:56 Makhlis, Lev
2004-06-26  0:14 ` Andries Brouwer
2004-06-25 15:41 Makhlis, Lev
2004-06-25 16:40 ` Andries Brouwer

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=20040625203914.GA5504@pclin040.win.tue.nl \
    --to=aebr@win.tue.nl \
    --cc=Lev_Makhlis@bmc.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®