]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
Fix unbounded-length malloc, controlled from usermode. The added check
authorkib <kib@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 28 Jun 2012 14:26:55 +0000 (14:26 +0000)
committerkib <kib@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 28 Jun 2012 14:26:55 +0000 (14:26 +0000)
commit90ea8cdc22b9b2c37d0071fdc6481b0d6019eb43
treecdf31bb3bf1ca0d177431f55ecb723d3ccae91e6
parent508cb62d349b97cf5ff8e03478f4eb024ba33010
Fix unbounded-length malloc, controlled from usermode. The added check
is performed before exact size of the buffer is calculated, but the
buffer cannot have size greater then the total space allocated for
extended attributes. The existing check is executing with precise
size, but it is too late, since buffer needs to be allocated in
advance.

Also, adapt to uio_resid being of ssize_t type.  Use lblktosize instead of
multiplying by fs block size by hand as well.

git-svn-id: svn://svn.freebsd.org/base/stable/9@237713 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/ufs/ffs/ffs_vnops.c