From: Jeremy Allison Date: Thu, 11 Jul 2013 00:10:17 +0000 (-0700) Subject: Fix bug #10010 - Missing integer wrap protection in EA list reading can cause server... X-Git-Tag: talloc-2.1.0~318 X-Git-Url: http://git.samba.org/samba.git/?p=nivanova%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=c8d8bb257ac390c89c4238ed86dfef02750b6049 Fix bug #10010 - Missing integer wrap protection in EA list reading can cause server to loop with DOS. Ensure we never wrap whilst adding client provided input. Signed-off-by: Jeremy Allison --- diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 800e2fd260b..bcba29a3e89 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -990,7 +990,19 @@ struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t if (next_offset == 0) { break; } + + /* Integer wrap protection for the increment. */ + if (offset + next_offset < offset) { + break; + } + offset += next_offset; + + /* Integer wrap protection for while loop. */ + if (offset + 4 < offset) { + break; + } + } return ea_list_head;