freebsd-skq/sys
raj 806a0172aa Fix cryptodev UIO creation.
Cryptodev uses UIO structure do get data from userspace and pass it to
cryptographic engines. Initially UIO size is equal to size of data passed to
engine, but if UIO is prepared for hash calculation an additional small space
is created to hold result of operation.

While creating space for the result, UIO I/O vector size is correctly
extended, but uio_resid field in UIO structure is not modified.

As bus_dma code uses uio_resid field to determine size of UIO DMA mapping,
resulting mapping hasn't correct size. This leads to a crash if all the
following conditions are met:

     1. Hardware cryptographic accelerator writes result of hash operation
        using DMA.
     2. Size of input data is less or equal than (n * PAGE_SIZE),
     3. Size of input data plus size of hash result is grather than
        (n * PAGE_SIZE, where n is the same as in point 2.

This patch fixes this problem by adding size of the extenstion to uio_resid
field in UIO structure.

Submitted by:	Piotr Ziecik kosmo ! semihalf dot com
Reviewed by:	philip
Obtained from:	Semihalf
2009-05-23 13:23:46 +00:00
..
amd64 Don't bother reading the initial value of the machine check banks during 2009-05-20 16:11:22 +00:00
arm Add cpu_flush_dcache() for use after non-DMA based I/O so that a 2009-05-18 18:37:18 +00:00
boot Improve the accf_dns_load description. 2009-05-17 10:58:50 +00:00
bsm Merge OpenBSM 1.1 from OpenBSM vendor branch to head. 2009-04-19 16:17:13 +00:00
cam Remove dead code. 2009-05-12 16:38:32 +00:00
cddl - back out direct map hack 2009-05-19 01:14:37 +00:00
compat Comment nits. 2009-05-20 18:36:17 +00:00
conf Remove the unmaintained University of Michigan NFSv4 client from 8.x 2009-05-22 12:35:12 +00:00
contrib tbr_timeout() is a timer driven function[1]. While the previous commit 2009-05-18 01:05:09 +00:00
crypto identify routine takes driver_t *, not device_t *. 2009-02-05 19:30:28 +00:00
ddb Prefer prototypes to k&r definitions. 2009-03-09 13:32:19 +00:00
dev Partial reversion of previous commit. The CXGB_SHUTDOWN flag does NOT 2009-05-22 18:26:47 +00:00
fs Fix the rpc_gss_secfind() call in nfs_commonkrpc.c so that 2009-05-23 00:40:17 +00:00
gdb
geom Check return value of gctl_get_asciiparam(). 2009-05-12 16:59:50 +00:00
gnu Remove empty files and do nto try to build them. 2009-05-18 17:20:24 +00:00
i386 We don't need d_thread_t for cross-branch portability here anymore. 2009-05-20 16:47:40 +00:00
ia64 Rename ia64_invalidate_icache() to ia64_sync_icache(). We're 2009-05-18 18:44:54 +00:00
isa Rename statclock_disable variable to atrtcclock_disable that it actually is, 2009-05-03 17:47:21 +00:00
kern Introduce the if_vmove() function, which will be used in the future 2009-05-22 22:09:00 +00:00
kgssapi
legacy/dev Garbage collect legacy upgt driver now that it is available in the new 2009-05-13 17:11:25 +00:00
libkern Add memmove() to the kernel, making the kernel compile with Clang. 2009-02-28 16:21:25 +00:00
mips Preset the modified bit in the PTE when pmap_enter() is called during a 2009-05-23 07:58:56 +00:00
modules Remove the unmaintained University of Michigan NFSv4 client from 8.x 2009-05-22 12:35:12 +00:00
net Set ifp->if_afdata_initialized to 0 while holding IF_AFDATA_LOCK on ifp, 2009-05-22 22:22:21 +00:00
net80211 Prepare to distribute sysctl code to reduce global definitions: 2009-05-20 20:18:01 +00:00
netatalk Lock interface address list lock around ifaddr inserts and deletes 2009-04-19 22:01:38 +00:00
netgraph Fix copy-paste bug in NGM_NETFLOW_SETCONFIG argument size verification. 2009-05-13 02:26:34 +00:00
netinet If including vnet.h one has to include opt_route.h as well. This is 2009-05-22 23:03:15 +00:00
netinet6 Pullup from p4 tip: 2009-05-21 18:05:17 +00:00
netipsec Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
netipx Make the SPX code use its own copies of insque()/remque(). 2009-04-26 21:03:27 +00:00
netnatm Replace d_thread_t * with struct thread *. 2009-05-20 17:00:16 +00:00
netncp
netsmb
nfs Add cpu_flush_dcache() for use after non-DMA based I/O so that a 2009-05-18 18:37:18 +00:00
nfsclient It seems this file was ignored by MRT, rnh locking changes and new-arpv2. 2009-05-23 00:07:55 +00:00
nfsserver Remove the thread argument from the FSD (File-System Dependent) parts of 2009-05-11 15:33:26 +00:00
nlm Remove the unmaintained University of Michigan NFSv4 client from 8.x 2009-05-22 12:35:12 +00:00
opencrypto Fix cryptodev UIO creation. 2009-05-23 13:23:46 +00:00
pc98 Add cpu_flush_dcache() for use after non-DMA based I/O so that a 2009-05-18 18:37:18 +00:00
pci For RTL8139C+ controllers, have controller handle padding short 2009-04-20 07:13:04 +00:00
powerpc Improve style(9), clean up. 2009-05-21 12:05:15 +00:00
rpc Remove the unmaintained University of Michigan NFSv4 client from 8.x 2009-05-22 12:35:12 +00:00
security Remove the thread argument from the FSD (File-System Dependent) parts of 2009-05-11 15:33:26 +00:00
sparc64 Add nge(4), nge(4) should work on all architectures. 2009-05-21 02:19:01 +00:00
sun4v Add cpu_flush_dcache() for use after non-DMA based I/O so that a 2009-05-18 18:37:18 +00:00
sys Introduce the if_vmove() function, which will be used in the future 2009-05-22 22:09:00 +00:00
tools Add SDT DTrace probes for VFS vnode operations in the vfs:vop 2009-03-29 03:30:15 +00:00
ufs Make 'struct acl' larger, as required to support NFSv4 ACLs. Provide 2009-05-22 15:56:43 +00:00
vm - back out direct map hack 2009-05-19 01:14:37 +00:00
xdr Add memmove() to the kernel, making the kernel compile with Clang. 2009-02-28 16:21:25 +00:00
xen Fix the Xen build for i386 PV mode. 2009-04-01 17:06:28 +00:00
Makefile Remove the unmaintained University of Michigan NFSv4 client from 8.x 2009-05-22 12:35:12 +00:00