diff options
author | ps <ps@FreeBSD.org> | 2005-07-14 20:08:27 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2005-07-14 20:08:27 +0000 |
commit | 3494397059c3dddd62077d8fe77cbcbbab71e4f9 (patch) | |
tree | cea0925fcb3fee95388e7d022a1a58a965f2f200 /sys/nfsclient | |
parent | fc39b92b3793131311838fd90a4793aec7c942f7 (diff) | |
download | FreeBSD-src-3494397059c3dddd62077d8fe77cbcbbab71e4f9.zip FreeBSD-src-3494397059c3dddd62077d8fe77cbcbbab71e4f9.tar.gz |
Fixes for NFS crashes on architectures that require strict alignment.
- Fix nfsm_disct() so that after pulling up data, the remaining data
is aligned if necessary.
- Fix nfs_clnt_tcp_soupcall() to bcopy() the rpc length out of the
mbuf (instead of casting m_data to a uint32).
Submitted by: Pyun YongHyeon
Reviewed by: Mohan Srinivasan
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 9bd1332..020cb55 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -814,7 +814,8 @@ nfs_clnt_tcp_soupcall(struct socket *so, void *arg, int waitflag) } if (mp == NULL) panic("nfs_clnt_tcp_soupcall: Got empty mbuf chain from sorecv\n"); - len = ntohl(*mtod(mp, u_int32_t *)) & ~0x80000000; + bcopy(mtod(mp, u_int32_t *), &len, sizeof(len)); + len = ntohl(len) & ~0x80000000; m_freem(mp); /* * This is SERIOUS! We are out of sync with the sender |