VirtualBox

Ignore:
Timestamp:
Jan 17, 2019 1:53:59 PM (6 years ago)
Author:
vboxsync
Message:

drivers/linux: adjust for new access_ok signature.
bugref:4567: Linux kernel driver maintenance.
The API for the access_ok() macro has changed in 5.0 to remove the first
argument. Contributed by Kyle Laker under the terms of the MIT licence.
Verified by Valdis Kletnieks. Thank you.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c

    r76553 r76859  
    6767{
    6868    IPRT_LINUX_SAVE_EFL_AC();
     69#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
     70    bool fRc = access_ok((void *)R3Ptr, 1);
     71#else
    6972    bool fRc = access_ok(VERIFY_READ, (void *)R3Ptr, 1);
     73#endif
    7074    IPRT_LINUX_RESTORE_EFL_AC();
    7175    return fRc;
     
    8387#else
    8488# error "PORT ME"
     89#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
     90    return !access_ok(pv, 1);
     91#else
    8592    return !access_ok(VERIFY_READ, pv, 1);
     93#endif /* LINUX_VERSION_CODE */
    8694#endif
    8795}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette