From the code we can see that the security checks at line 691 and line 692 aim
to filter integer overflows. Specifically, a handler, i.e. function
"overflow_exit" will be invoked if the first addition "dget_len + extra_len"
overflows (protected by the check at line 691) or the second addition "dget_len
+ extra_len + name_len" overflows (protected by the check at line 692).
Here, we want to say that the later check at line 692 is insufficient to catch
integer overflow. That means, there exist some integer overflows, which can
bypass the later check.
Assume that it's on a 32-bit machine, and "dget_len" is 100, "extra_len" is
also 100, whereas "name_len" takes a very big integer value, e.g., 0xffff ffff.
Hence, "dget_len + extra_len + name_len" overflows to 199, which is bigger than
"dget_len", i.e. 100. As a result, an integer overflow indeed happens here,
however, the overflow check at line 692 doesn't catch it. Furthermore, buffer
overflow would occur at line 698.
One possible workaround is to use a much stricter overflow check at line 692,
"dget_len + extra_len + name_len < dget_len + extra_len".
You are receiving this mail because:
You are the QA Contact for the bug.
Re: [Bug 12568] Integer overflow still exists in xattrs.c, leading to buffer overflow
On Sun 08 Oct 2017, just subscribed for rsync-qa from bugzilla via rsync wrote:
> --- Comment #1 from Wayne Davison <[hidden email]> ---
> I've committed a fix for this into git. Many thanks for pointing this out.
> Sorry for how slow I've been lately.