fault-inject-usercopy.h 496 B

12345678910111213141516171819202122
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __LINUX_FAULT_INJECT_USERCOPY_H__
  3. #define __LINUX_FAULT_INJECT_USERCOPY_H__
  4. /*
  5. * This header provides a wrapper for injecting failures to user space memory
  6. * access functions.
  7. */
  8. #include <linux/types.h>
  9. #ifdef CONFIG_FAULT_INJECTION_USERCOPY
  10. bool should_fail_usercopy(void);
  11. #else
  12. static inline bool should_fail_usercopy(void) { return false; }
  13. #endif /* CONFIG_FAULT_INJECTION_USERCOPY */
  14. #endif /* __LINUX_FAULT_INJECT_USERCOPY_H__ */