fbf77104c30f51ed927de2493730c8f1fbd4cb33 |
|
19-Aug-2016 |
William Roberts <william.c.roberts@intel.com> |
libsepol: port str_read from kernel Rather than duplicating the following sequence: 1. Read len from file 2. alloc up space based on 1 3. read the contents into the buffer from 2 4. null terminate the buffer from 2 Use the str_read() function that is in the kernel, which collapses steps 2 and 4. This not only reduces redundant code, but also has the side-affect of providing a central check on zero_or_saturated lengths from step 1 when generating string values. Signed-off-by: William Roberts <william.c.roberts@intel.com>
/external/selinux/libsepol/src/private.h
|
8673854fb8b7006e92a4b1ce338ed229b0e1a9f6 |
|
16-Aug-2016 |
William Roberts <william.c.roberts@intel.com> |
libsepol: fix overflow and 0 length allocations Throughout libsepol, values taken from sepolicy are used in places where length == 0 or length == <saturated> matter, find and fix these. Also, correct any type mismatches noticed along the way. Signed-off-by: William Roberts <william.c.roberts@intel.com>
/external/selinux/libsepol/src/private.h
|
bedef7d12493e5785537c1f8e46ce32c3e34bf32 |
|
03-May-2016 |
Stephen Smalley <sds@tycho.nsa.gov> |
libsepol,checkpolicy,secilc: Replace #ifdef DARWIN with __APPLE__. As per discussion in https://android-review.googlesource.com/#/c/221980, we should be using #ifdef __APPLE__ rather than our own custom-defined DARWIN for building on MacOS X. Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/external/selinux/libsepol/src/private.h
|
84f6ac246f5980f831a5777d53c0a0bd6ad17d3c |
|
23-Feb-2012 |
Stephen Smalley <sds@tycho.nsa.gov> |
libsepol: Android/MacOS X build support Android/MacOS X build support for libsepol. Create a Android.mk file for Android build integration. Introduce DARWIN ifdefs for building on MacOS X. Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
/external/selinux/libsepol/src/private.h
|
2f68def6338d072ae13328cf6357a4468408ce1b |
|
18-Oct-2011 |
Steve Lawrence <slawrence@tresys.com> |
libsepol: Move ebitmap_* functions from mcstrans to libsepol This patches moves some ebitmap functions (and, xor, not, etc.) from mcstrans into libsepol, where they really belong and could be used by other applications (e.g. CIL) Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
/external/selinux/libsepol/src/private.h
|
505c75aad7f16e0db9ccfeb04eaa70f242e6b060 |
|
29-Sep-2009 |
Paul Nuzzi <pjnuzzi@tycho.ncsc.mil> |
libsepol: Add support for multiple target OSes On Wed, 2009-09-16 at 09:58 -0400, Joshua Brindle wrote: > I'd rather have separate ocontext structs for each system. That way it > is very easy to understand which ones apply to which system and you > don't get a crazy out of context ocontext struct. > I looked into having separate ocontext structs but that would involve changing a lot of files making the patch much larger and more intrusive. > > } u; > > union { > > uint32_t sclass; /* security class for genfs */ > > @@ -313,6 +323,17 @@ typedef struct genfs { > > #define OCON_NODE6 6 /* IPv6 nodes */ > > #define OCON_NUM 7 > > > > +/* object context array indices for Xen */ > > +#define OCON_ISID 0 /* initial SIDs */ > > +#define OCON_PIRQ 1 /* physical irqs */ > > +#define OCON_IOPORT 2 /* io ports */ > > +#define OCON_IOMEM 3 /* io memory */ > > +#define OCON_DEVICE 4 /* pci devices */ > > +#define OCON_DUMMY1 5 /* reserved */ > > +#define OCON_DUMMY2 6 /* reserved */ > > +#define OCON_NUM 7 > > + > > + > > > Should these be namespaced? What if <random other system> has io port > objects? You'd have to align them with each other and you have a mess of > keeping the numbers the same (you already do this with OCON_ISID) Variables have been namespaced and there is no more overlap with OCON_ISID. > Also we are relying on having the same number of OCON's which isn't good > I don't think. As much as I hate the policydb_compat_info (read: alot) > why aren't we using that to say how many ocons a xen policy really has? OCON_NUM is now dynamically read through policydb_compat_info. > This is messy, why not an ocontext_selinux_free() and > ocontext_xen_free() (note: I realize the xen_free() one won't do > anything except freep the ocontext_t) > done. > > > > len = buf[1]; > > - if (len != strlen(target_str)&& > > - (!alt_target_str || len != strlen(alt_target_str))) { > > - ERR(fp->handle, "policydb string length %zu does not match " > > - "expected length %zu", len, strlen(target_str)); > > + if (len> 32) { > > > > magic number 32? #defined. Thanks for your input. Below is the updated patch for libsepol. ---- libsepol/include/sepol/policydb/policydb.h | 28 ++ libsepol/src/expand.c | 85 +++++++- libsepol/src/policydb.c | 295 +++++++++++++++++++++++------ libsepol/src/policydb_internal.h | 1 libsepol/src/private.h | 4 libsepol/src/write.c | 93 ++++++++- 6 files changed, 443 insertions(+), 63 deletions(-) Signed-off-by: Joshua Brindle <method@manicmethod.com>
/external/selinux/libsepol/src/private.h
|
13cd4c8960688af11ad23b4c946149015c80d549 |
|
19-Aug-2008 |
Joshua Brindle <method@manicmethod.com> |
initial import from svn trunk revision 2950
/external/selinux/libsepol/src/private.h
|