]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: prevent integer overflow in nxt_dir_entry()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 6 Sep 2018 09:47:51 +0000 (12:47 +0300)
committerSteve French <stfrench@microsoft.com>
Wed, 12 Sep 2018 14:27:57 +0000 (09:27 -0500)
commit0d2b3129752c9cf69f42d7eb486b1ca1c2159581
treec95029b8a3efc9cdfbb70b9d666812c44ff18b17
parenta22ebcadb7edd88133efbb24c38830d6daf3f33b
cifs: prevent integer overflow in nxt_dir_entry()

The "old_entry + le32_to_cpu(pDirInfo->NextEntryOffset)" can wrap
around so I have added a check for integer overflow.

Reported-by: Dr Silvio Cesare of InfoSect <silvio.cesare@gmail.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
fs/cifs/readdir.c