diff options
author | ambrisko <ambrisko@FreeBSD.org> | 2008-11-14 21:05:45 +0000 |
---|---|---|
committer | ambrisko <ambrisko@FreeBSD.org> | 2008-11-14 21:05:45 +0000 |
commit | ba6c553529d0211e995ceb640224f07e165c217a (patch) | |
tree | bc97b13ba213422451a796d47530ec09cf81a328 /sys | |
parent | 367ae23f20b56dce1c186cf0edd2e86fad0b3361 (diff) | |
download | FreeBSD-src-ba6c553529d0211e995ceb640224f07e165c217a.zip FreeBSD-src-ba6c553529d0211e995ceb640224f07e165c217a.tar.gz |
When running a 32bit app. on amd64, ensure the bits above 32bit
are zero for the copyout. Confirmed by LSI.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/mfi/mfi.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c index f8b9e44..18c7400 100644 --- a/sys/dev/mfi/mfi.c +++ b/sys/dev/mfi/mfi.c @@ -2130,6 +2130,14 @@ mfi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td) ->mfi_frame.raw[ioc->mfi_sense_off], &sense_ptr.sense_ptr_data[0], sizeof(sense_ptr.sense_ptr_data)); +#ifdef __amd64__ + if (cmd != MFI_CMD) { + /* + * not 64bit native so zero out any address + * over 32bit */ + sense_ptr.high = 0; + } +#endif error = copyout(cm->cm_sense, sense_ptr.user_space, ioc->mfi_sense_len); if (error != 0) { @@ -2353,6 +2361,13 @@ mfi_linux_ioctl_int(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_threa ->lioc_frame.raw[l_ioc.lioc_sense_off], &sense_ptr.sense_ptr_data[0], sizeof(sense_ptr.sense_ptr_data)); +#ifdef __amd64__ + /* + * only 32bit Linux support so zero out any + * address over 32bit + */ + sense_ptr.high = 0; +#endif error = copyout(cm->cm_sense, sense_ptr.user_space, l_ioc.lioc_sense_len); if (error != 0) { |