Changeset 21268 in vbox for trunk/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp
- Timestamp:
- Jul 6, 2009 6:35:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp
r21260 r21268 169 169 switch (pParm->type) 170 170 { 171 case VMMDevHGCMParmType_32bit: 172 case VMMDevHGCMParmType_64bit: 173 break; 174 175 case VMMDevHGCMParmType_PhysAddr: 176 if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER) 177 rc = VERR_INVALID_PARAMETER; 178 break; 179 171 180 case VMMDevHGCMParmType_LinAddr_Locked_In: 172 pParm->type = VMMDevHGCMParmType_LinAddr_In; 181 if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER) 182 rc = VERR_INVALID_PARAMETER; 183 else 184 pParm->type = VMMDevHGCMParmType_LinAddr_In; 173 185 break; 174 186 case VMMDevHGCMParmType_LinAddr_Locked_Out: 175 pParm->type = VMMDevHGCMParmType_LinAddr_Out; 187 if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER) 188 rc = VERR_INVALID_PARAMETER; 189 else 190 pParm->type = VMMDevHGCMParmType_LinAddr_Out; 176 191 break; 177 192 case VMMDevHGCMParmType_LinAddr_Locked: 178 pParm->type = VMMDevHGCMParmType_LinAddr; 193 if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER) 194 rc = VERR_INVALID_PARAMETER; 195 else 196 pParm->type = VMMDevHGCMParmType_LinAddr; 179 197 break; 180 198 … … 190 208 These kind of problems actually applies to some patched linux kernels too, including older 191 209 fedora releases. (The patch is the infamous 4G/4G patch, aka 4g4g, by Ingo Molnar.) */ 192 rc = vbglLockLinear (&apvCtx[iParm], (void *)pParm->u.Pointer.u.linearAddr, pParm->u.Pointer.size, (pParm->type == VMMDevHGCMParmType_LinAddr_In) ? false : true /* write access */); 193 break; 210 rc = vbglLockLinear (&apvCtx[iParm], (void *)pParm->u.Pointer.u.linearAddr, pParm->u.Pointer.size, 211 (pParm->type == VMMDevHGCMParmType_LinAddr_In) ? false : true /* write access */, 212 fFlags); 213 break; 214 194 215 default: 195 /* make gcc happy */216 rc = VERR_INVALID_PARAMETER; 196 217 break; 197 218 } … … 333 354 switch (pParm->type) 334 355 { 356 case VMMDevHGCMParmType_32bit: 357 case VMMDevHGCMParmType_64bit: 358 break; 359 360 case VMMDevHGCMParmType_PhysAddr: 361 if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER) 362 rc = VERR_INVALID_PARAMETER; 363 break; 364 335 365 case VMMDevHGCMParmType_LinAddr_Locked_In: 336 pParm->type = VMMDevHGCMParmType_LinAddr_In; 366 if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER) 367 rc = VERR_INVALID_PARAMETER; 368 else 369 pParm->type = VMMDevHGCMParmType_LinAddr_In; 337 370 break; 338 371 case VMMDevHGCMParmType_LinAddr_Locked_Out: 339 pParm->type = VMMDevHGCMParmType_LinAddr_Out; 372 if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER) 373 rc = VERR_INVALID_PARAMETER; 374 else 375 pParm->type = VMMDevHGCMParmType_LinAddr_Out; 340 376 break; 341 377 case VMMDevHGCMParmType_LinAddr_Locked: 342 pParm->type = VMMDevHGCMParmType_LinAddr; 378 if ((fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER) 379 rc = VERR_INVALID_PARAMETER; 380 else 381 pParm->type = VMMDevHGCMParmType_LinAddr; 343 382 break; 344 383 … … 354 393 These kind of problems actually applies to some patched linux kernels too, including older 355 394 fedora releases. (The patch is the infamous 4G/4G patch, aka 4g4g, by Ingo Molnar.) */ 356 rc = vbglLockLinear (&apvCtx[iParm], (void *)pParm->u.Pointer.u.linearAddr, pParm->u.Pointer.size, (pParm->type == VMMDevHGCMParmType_LinAddr_In) ? false : true /* write access */); 357 break; 395 rc = vbglLockLinear (&apvCtx[iParm], (void *)pParm->u.Pointer.u.linearAddr, pParm->u.Pointer.size, 396 (pParm->type == VMMDevHGCMParmType_LinAddr_In) ? false : true /* write access */, 397 fFlags); 398 break; 399 358 400 default: 359 /* make gcc happy */401 rc = VERR_INVALID_PARAMETER; 360 402 break; 361 403 }
Note:
See TracChangeset
for help on using the changeset viewer.