pal_security.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* -*- mode:c; c-file-style:"k&r"; c-basic-offset: 4; tab-width:4; indent-tabs-mode:nil; mode:auto-fill; fill-column:78; -*- */
  2. /* vim: set ts=4 sw=4 et tw=78 fo=cqt wm=0: */
  3. /* Copyright (C) 2014 OSCAR lab, Stony Brook University
  4. This file is part of Graphene Library OS.
  5. Graphene Library OS is free software: you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation, either version 3 of the
  8. License, or (at your option) any later version.
  9. Graphene Library OS is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #ifndef PAL_SECURITY_H
  16. #define PAL_SECURITY_H
  17. #include "pal.h"
  18. #include "sgx_arch.h"
  19. typedef char PAL_SEC_STR[255];
  20. struct pal_sec {
  21. /* host credentials */
  22. PAL_NUM instance_id;
  23. PAL_IDX ppid, pid, uid, gid;
  24. /* file name of enclave image */
  25. PAL_SEC_STR enclave_image;
  26. /* enclave information */
  27. sgx_arch_hash_t mrenclave;
  28. sgx_arch_hash_t mrsigner;
  29. sgx_arch_attributes_t enclave_attributes;
  30. /* remaining heap usable by application */
  31. PAL_PTR heap_min, heap_max;
  32. /* executable name, addr and size */
  33. PAL_SEC_STR exec_name;
  34. PAL_IDX exec_fd;
  35. PAL_PTR exec_addr;
  36. PAL_NUM exec_size;
  37. /* manifest name, addr and size */
  38. PAL_SEC_STR manifest_name;
  39. PAL_IDX manifest_fd;
  40. PAL_PTR manifest_addr;
  41. PAL_NUM manifest_size;
  42. /* need three proc fds if it has a parent */
  43. PAL_IDX proc_fds[3];
  44. /* additional information */
  45. PAL_SEC_STR pipe_prefix;
  46. PAL_IDX mcast_port, mcast_srv, mcast_cli;
  47. /* an untrusted allocator shared with enclave */
  48. struct {
  49. unsigned int alignment;
  50. void * slabmgr;
  51. struct mutex_handle * lock;
  52. } untrusted_allocator;
  53. #ifdef DEBUG
  54. PAL_BOL in_gdb;
  55. #endif
  56. };
  57. #ifdef IN_ENCLAVE
  58. extern struct pal_sec pal_sec;
  59. #endif
  60. #define GRAPHENE_TEMPDIR "/tmp/graphene"
  61. #define GRAPHENE_PIPEDIR GRAPHENE_TEMPDIR "/pipes"
  62. #define PROC_INIT_FD 255
  63. #define MCAST_GROUP "239.0.0.1"
  64. #endif /* PAL_SECURITY_H */