Advertisement
hellsy

/etc/portage/patches/app-emulation/qemu-user/syscall.patch

Jan 5th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.87 KB | None | 0 0
  1. --- a/linux-user/syscall.c      2014-01-05 17:53:52.931343033 +0400
  2. +++ b/linux-user/syscall.c      2014-01-05 18:50:44.167192784 +0400
  3. @@ -109,6 +109,7 @@
  4.  #include <linux/filter.h>
  5.  #include "linux_loop.h"
  6.  #include "cpu-uname.h"
  7. +#include "sys/capability.h"
  8.  
  9.  #include "qemu.h"
  10.  
  11. @@ -7723,9 +7724,35 @@
  12.          unlock_user(p, arg1, ret);
  13.          break;
  14.      case TARGET_NR_capget:
  15. -        goto unimplemented;
  16. +        {
  17. +            struct __user_cap_header_struct *target_hdrp;
  18. +            struct __user_cap_data_struct *target_datap;
  19. +
  20. +            if (!lock_user_struct(VERIFY_READ, target_hdrp, arg1, 1)) goto efault;
  21. +            if (!lock_user_struct(VERIFY_WRITE, target_datap, arg2, 1)) {
  22. +                unlock_user_struct(target_hdrp, arg1, 0);
  23. +                goto efault;
  24. +            }
  25. +            ret = get_errno( capget( target_hdrp, target_datap) );
  26. +            unlock_user_struct(target_hdrp, arg1, 0);
  27. +            unlock_user_struct(target_datap, arg2, 1);
  28. +            break;
  29. +        }
  30.      case TARGET_NR_capset:
  31. -        goto unimplemented;
  32. +        {
  33. +            struct __user_cap_header_struct *target_hdrp;
  34. +            struct __user_cap_data_struct *target_datap;
  35. +
  36. +            if (!lock_user_struct(VERIFY_READ, target_hdrp, arg1, 1)) goto efault;
  37. +            if (!lock_user_struct(VERIFY_READ, target_datap, arg2, 1)) {
  38. +                unlock_user_struct(target_hdrp, arg1, 0);
  39. +                goto efault;
  40. +            }
  41. +            ret = get_errno( capset( target_hdrp, target_datap) );
  42. +            unlock_user_struct(target_hdrp, arg1, 0);
  43. +            unlock_user_struct(target_datap, arg2, 0);
  44. +            break;
  45. +        }
  46.      case TARGET_NR_sigaltstack:
  47.  #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_MIPS) || \
  48.      defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_ALPHA) || \
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement