Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1462641
| From | Vegard Nossum <vegard.nossum@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] fs/pipe: fix shift by 64 in F_SETPIPE_SZ |
| Date | 2016-08-15 11:00 +0200 |
| Message-ID | <s6lUt-3kK-11@gated-at.bofh.it> (permalink) |
| References | <s5jUK-1Cc-11@gated-at.bofh.it> <s6l85-33e-1@gated-at.bofh.it> <s6lrr-39X-13@gated-at.bofh.it> <s6lB7-3do-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] fs/pipe: fix shift by 64 in F_SETPIPE_SZ Vegard Nossum <vegard.nossum@oracle.com> - 2016-08-12 14:40 +0200
Re: [PATCH] fs/pipe: fix shift by 64 in F_SETPIPE_SZ Willy Tarreau <w@1wt.eu> - 2016-08-15 10:10 +0200
Re: [PATCH] fs/pipe: fix shift by 64 in F_SETPIPE_SZ Vegard Nossum <vegard.nossum@oracle.com> - 2016-08-15 10:30 +0200
Re: [PATCH] fs/pipe: fix shift by 64 in F_SETPIPE_SZ Willy Tarreau <w@1wt.eu> - 2016-08-15 10:40 +0200
Re: [PATCH] fs/pipe: fix shift by 64 in F_SETPIPE_SZ Vegard Nossum <vegard.nossum@oracle.com> - 2016-08-15 11:00 +0200
csiph-web