bug.c 403 B

123456789101112131415161718192021
  1. /*
  2. * Copyright (C) 2006 Jeff Dike (jdike@addtoit.com)
  3. * Licensed under the GPL V2
  4. */
  5. #include <linux/uaccess.h>
  6. /*
  7. * Mostly copied from i386/x86_86 - eliminated the eip < PAGE_OFFSET because
  8. * that's not relevant in skas mode.
  9. */
  10. int is_valid_bugaddr(unsigned long eip)
  11. {
  12. unsigned short ud2;
  13. if (probe_kernel_address((unsigned short __user *)eip, ud2))
  14. return 0;
  15. return ud2 == 0x0b0f;
  16. }