All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vegard Nossum <vegard.nossum@oracle.com>
To: Willy Tarreau <w@1wt.eu>
Cc: Al Viro <viro@zeniv.linux.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/pipe: fix shift by 64 in F_SETPIPE_SZ
Date: Mon, 15 Aug 2016 10:55:34 +0200	[thread overview]
Message-ID: <57B18386.8050401@oracle.com> (raw)
In-Reply-To: <20160815083443.GC14695@1wt.eu>

On 08/15/2016 10:34 AM, Willy Tarreau wrote:
> On Mon, Aug 15, 2016 at 10:22:38AM +0200, Vegard Nossum wrote:
>> In both cases I found it better to be more conservative in what we
>> accept, i.e. I haven't checked whether the rest of the code would
>> support pipe buffers > INT_MAX on 64-bit and I think it's a slightly
>> bigger job to check that (not just for the person making the change, but
>> for everybody else looking at/reviewing it) -- it's already tricky
>> enough to verify that this change by itself is safe and correct IMHO.
>
> Well in fact in my opinion it's the opposite, because if we ensure the
> function works well over all its argument type's range, the caller has
> less trouble figuring what sub-part of the range is OK. This is exactly
> the current issue where you have to ensure that :
>
>       unsigned int arg <= INT_MAX

It's not just about this one function, but all the other code in pipe.c
now has to cope with pipe buffers > INT_MAX as well.

For example all the fields in struct pipe_inode_info referring to
buffers are unsigned int (nrbufs, curbuf, buffers). Unless we also
change those to unsigned long, the code will definitely not support
buffer sizes up to LONG_MAX on 64-bit.

That's why I think it's a much, much bigger task to review (and make)
such a change.


Vegard

      reply	other threads:[~2016-08-15  8:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12 12:35 [PATCH] fs/pipe: fix shift by 64 in F_SETPIPE_SZ Vegard Nossum
2016-08-15  8:06 ` Willy Tarreau
2016-08-15  8:22   ` Vegard Nossum
2016-08-15  8:34     ` Willy Tarreau
2016-08-15  8:55       ` Vegard Nossum [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=57B18386.8050401@oracle.com \
    --to=vegard.nossum@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=w@1wt.eu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.