1. 19 Nov, 2017 1 commit
  2. 20 Jul, 2017 9 commits
    • Stephen Smalley's avatar
      tests: Add a self-protection test suite · d278473d
      Stephen Smalley authored
      Add a self-protection test suite with a set of tests
      to check whether one can overwrite read-only data
      and text, and whether one can execute from data,
      stack, or heap buffers.  These tests are modeled after
      a subset of the lkdtm tests in the Linux kernel.
      
      These tests have twice caught bugs in the Zephyr NXP MPU
      driver, once during initial testing/review of the code
      (in its earliest forms on gerrit, reported to the original
      author there) and most recently the regression introduced
      by commit bacbea6e
      
       ("arm: nxp: mpu: Rework handling
      of region descriptor 0"), which was fixed by
      commit a8aa9d4f3dbbe8 ("arm: nxp: mpu: Fix region descriptor
      0 attributes") after being reported.
      
      This is intended to be a testsuite of self-protection features
      rather than just a test of MPU functionality.  It is envisioned
      that these tests will be expanded to cover a wider range of
      protection features beyond just memory protection, and the
      current tests are independent of any particular enforcement
      mechanism (e.g. MPU, MMU, or other).
      
      The tests are intended to be cross-platform, and have been
      built and run on both x86- and ARM-based boards.  The tests
      currently fail on x86-based boards, but this is an accurate
      reflection of current protections and should change as MMU
      support arrives.
      
      The tests leverage the ztest framework, making them suitable
      for incorporation into automated regression testing for Zephyr.
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      d278473d
    • Stephen Smalley's avatar
      tests/ztest: Add ztest_test_pass() · 01142147
      Stephen Smalley authored
      
      ztest provides a ztest_test_fail() interface to fail the currently
      running test, but does not provide an equivalent ztest_test_pass().
      Normally a test passes just by returning without an assertion failure
      or other call to ztest_test_fail().  However, if the correct behavior
      for a test is to trigger a fatal fault (as with tests/kernel/fatal or
      protection or MPU tests), then we need a way for the test to pass the
      currently running test before aborting the current thread.
      Otherwise, ztest hangs forever in run_test() on the
      k_sem_take(&test_end_signal, K_FOREVER) call.  Add
      a ztest_test_pass() interface and implement it for kernel and
      userspace variants of ztest.  This interface will be used in the
      protection tests.
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      01142147
    • Maureen Helm's avatar
      arm: nxp: mpu: Fix region descriptor 0 attributes · 96ea2b73
      Maureen Helm authored
      
      Clearing fields in the region descriptor attributes doesn't always have
      the expected effect of revoking permissions. In the case of bus master
      supervisor mode fields (MxSM), setting to zero actually enables read,
      write, and execute access.
      
      When we reworked handling of region descriptor 0, we inadvertently
      enabled execution from RAM by clearing the MxSM fields and enabling the
      descriptor. This caused samples/mpu_test run to throw a usage fault
      instead of an MPU-triggered bus fault.
      
      Fix this by setting all the MxSM fields to 2'b11, which gives supervisor
      mode the same access as user mode.
      Signed-off-by: default avatarMaureen Helm <maureen.helm@nxp.com>
      96ea2b73
    • Maureen Helm's avatar
      arm: nxp: mpu: Fix off-by-1 error in region index calculation · c1dd8ff8
      Maureen Helm authored
      
      Both the ARM and NXP MPU drivers incorrectly calculated the region index
      by assuming the region type (e.g., THREAD_STACK_GUARD_REGION) was
      zero-indexed, when in reality it is one-indexed. This had the effect of
      wasting one region.
      Signed-off-by: default avatarMaureen Helm <maureen.helm@nxp.com>
      c1dd8ff8
    • Maureen Helm's avatar
      arm: nxp: mpu: Rework handling of region descriptor 0 · 85c974ab
      Maureen Helm authored
      
      The NXP MPU requires special handling of region descriptor 0 to
      guarantee that the debugger has access to the entire address space. It
      does not allow writes from the core to affect the start or end
      addresses, or the permissions associated with the debugger.
      
      The original implementation of this driver attempted to work around
      region descriptor 0, resulting in an off-by-1 error caught by Coverity.
      
      Instead, define region descriptor 0 explicitly in the mpu_regions array,
      and add some asserts to ensure that one doesn't try to change its start
      or end addresses. This has an added benefit such that more permissions
      can be enabled in region 0 if desired, whereas the previous
      implementation always forced all writable permissions to be cleared.
      
      Coverity-CID: 170473
      Jira: ZEP-2258
      Signed-off-by: default avatarMaureen Helm <maureen.helm@nxp.com>
      85c974ab
    • Anas Nashif's avatar
      ci: update CI scripts · 815cf23f
      Anas Nashif authored
      
      Sync with master
      Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
      815cf23f
    • Anas Nashif's avatar
      955405d4
    • Anas Nashif's avatar
      cfe24958
    • Anas Nashif's avatar
  3. 16 Jun, 2017 4 commits
  4. 15 Jun, 2017 1 commit
  5. 14 Jun, 2017 7 commits
  6. 13 Jun, 2017 3 commits
    • Carles Cufi's avatar
      doc: Fill the Bluetooth section in the 1.8 release notes · d3894921
      Carles Cufi authored
      
      Used the following command to get the full list of changes:
      
      (v1.8-branch) $ git log v1.7.0.. subsys/bluetooth/
      Signed-off-by: default avatarCarles Cufi <carles.cufi@nordicsemi.no>
      d3894921
    • Jukka Rissanen's avatar
      doc: Add networking changes to 1.8 release note · 8d963ce7
      Jukka Rissanen authored
      
      Add general description of network stack changes in v1.8 and
      two IEEE 802.15.4 driver additions in Drivers section.
      Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
      8d963ce7
    • Inaky Perez-Gonzalez's avatar
      scripts: look for files with no licensing info · 36075ec4
      Inaky Perez-Gonzalez authored
      Bash hack that will parse the list of files known to git, filter the
      ones for which we think we have licensing info, filter trivial ones
      and print the non-compliant ones to stdout:
      
      $ cd WHEREVER/zephyr.git
      $ scripts/scan-no-license.sh  > no-license
      I: 6327 files total
      I: 3568 after filtering known issues
      I: 3568 files before, 1828 after filtering token 'SPDX-License-Identifier'
      I: 1828 files before, 1027 after filtering token 'Copyright'
      I: 1027 files before, 1023 after filtering token 'License'
      I: 1023 files before, 1017 after filtering token 'licenseText'
      I: 1017 files before, 78 after filtering token '([Cc])'
      I: 78 files without license
      $ head no-license
      arch/nios2/soc/nios2f-zephyr/cpu/ghrd_10m50da.qsys
      arch/nios2/soc/nios2f-zephyr/cpu/ghrd_10m50da.qws
      arch/nios2/soc/nios2f-zephyr/cpu/ghrd_10m50da.sof
      arch/nios2/soc/nios2f-zephyr/cpu/ghrd_10m50da.sopcinfo
      arch/nios2/soc/nios2f-zephyr/cpu/ghrd_10m50da_top.v
      ...
      
      Signed-off-by: Inaky Perez-Gonzalez <inaky....
      36075ec4
  7. 12 Jun, 2017 1 commit
  8. 09 Jun, 2017 14 commits