]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r237366:
authorkib <kib@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 28 Jun 2012 16:54:10 +0000 (16:54 +0000)
committerkib <kib@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 28 Jun 2012 16:54:10 +0000 (16:54 +0000)
commit4352e36cfca0a5c64cfe3dc055f45f05cbecba95
treef0acfbaa20fc2f890e9eef6025e2432efb2abd1b
parent2a4e7c2ade3aaf21b38c1828ee23c7953e00ae99
MFC r237366:
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/8@237717 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/ufs/ffs/ffs_vnops.c