Re: [PATCH 1/2] ipc, msg: fix message length check for negative values

2013-11-03 Thread Mathias Krause
On 3 November 2013 01:35, Linus Torvalds wrote: > On Sat, Nov 2, 2013 at 2:26 PM, Mathias Krause wrote: >> On 64 bit systems the test for negative message sizes is bogus as the >> size, which may be positive when evaluated as a long, will get truncated >> to an int when passed to load_msg(). > >

Re: [PATCH 1/2] ipc, msg: fix message length check for negative values

2013-11-02 Thread Linus Torvalds
On Sat, Nov 2, 2013 at 2:26 PM, Mathias Krause wrote: > On 64 bit systems the test for negative message sizes is bogus as the > size, which may be positive when evaluated as a long, will get truncated > to an int when passed to load_msg(). Quite frankly, wouldn't it be much nicer to just fix "loa

[PATCH 1/2] ipc, msg: fix message length check for negative values

2013-11-02 Thread Mathias Krause
On 64 bit systems the test for negative message sizes is bogus as the size, which may be positive when evaluated as a long, will get truncated to an int when passed to load_msg(). So a long might very well contain a positive value but when truncated to an int it would become negative. That in comb