)]}'
{
  "commit": "38addce8b600ca335dc86fa3d48c890f1c6fa1f4",
  "tree": "6d191ed116f54aebd2e2c3e6c2937992ef86f928",
  "parents": [
    "c8d2bc9bc39ebea8437fd974fdbc21847bb897a3"
  ],
  "author": {
    "name": "Emese Revfy",
    "email": "re.emese@gmail.com",
    "time": "Mon Jun 20 20:41:19 2016 +0200"
  },
  "committer": {
    "name": "Kees Cook",
    "email": "keescook@chromium.org",
    "time": "Mon Oct 10 14:51:44 2016 -0700"
  },
  "message": "gcc-plugins: Add latent_entropy plugin\n\nThis adds a new gcc plugin named \"latent_entropy\". It is designed to\nextract as much possible uncertainty from a running system at boot time as\npossible, hoping to capitalize on any possible variation in CPU operation\n(due to runtime data differences, hardware differences, SMP ordering,\nthermal timing variation, cache behavior, etc).\n\nAt the very least, this plugin is a much more comprehensive example for\nhow to manipulate kernel code using the gcc plugin internals.\n\nThe need for very-early boot entropy tends to be very architecture or\nsystem design specific, so this plugin is more suited for those sorts\nof special cases. The existing kernel RNG already attempts to extract\nentropy from reliable runtime variation, but this plugin takes the idea to\na logical extreme by permuting a global variable based on any variation\nin code execution (e.g. a different value (and permutation function)\nis used to permute the global based on loop count, case statement,\nif/then/else branching, etc).\n\nTo do this, the plugin starts by inserting a local variable in every\nmarked function. The plugin then adds logic so that the value of this\nvariable is modified by randomly chosen operations (add, xor and rol) and\nrandom values (gcc generates separate static values for each location at\ncompile time and also injects the stack pointer at runtime). The resulting\nvalue depends on the control flow path (e.g., loops and branches taken).\n\nBefore the function returns, the plugin mixes this local variable into\nthe latent_entropy global variable. The value of this global variable\nis added to the kernel entropy pool in do_one_initcall() and _do_fork(),\nthough it does not credit any bytes of entropy to the pool; the contents\nof the global are just used to mix the pool.\n\nAdditionally, the plugin can pre-initialize arrays with build-time\nrandom contents, so that two different kernel builds running on identical\nhardware will not have the same starting values.\n\nSigned-off-by: Emese Revfy \u003cre.emese@gmail.com\u003e\n[kees: expanded commit message and code comments]\nSigned-off-by: Kees Cook \u003ckeescook@chromium.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fd6e9712af81b5bab38f871665d2a2df66d8468d",
      "old_mode": 33188,
      "old_path": "arch/Kconfig",
      "new_id": "ae80cd24e8f0462c5143bf3bf2996844780a5e8c",
      "new_mode": 33188,
      "new_path": "arch/Kconfig"
    },
    {
      "type": "modify",
      "old_id": "fe4c075bcf50eda75905e7c53b4830914cef5b00",
      "old_mode": 33188,
      "old_path": "arch/powerpc/kernel/Makefile",
      "new_id": "62df36c3f138c6bb9f6ac16adcc5e341414ff052",
      "new_mode": 33188,
      "new_path": "arch/powerpc/kernel/Makefile"
    },
    {
      "type": "modify",
      "old_id": "3d6e9815cd854d6d093e8082df312b63790b3d11",
      "old_mode": 33188,
      "old_path": "include/linux/random.h",
      "new_id": "a59c74cdb1eb0f88a6ea6c4952f6574bbfd58bc7",
      "new_mode": 33188,
      "new_path": "include/linux/random.h"
    },
    {
      "type": "modify",
      "old_id": "a8a58e2794a50469d465fad1a6939a4b68ec1114",
      "old_mode": 33188,
      "old_path": "init/main.c",
      "new_id": "2858be732f6d25dd8431cd994645c8c6af3828c2",
      "new_mode": 33188,
      "new_path": "init/main.c"
    },
    {
      "type": "modify",
      "old_id": "beb31725f7e2746fb17cdd305c4193ab2c70e551",
      "old_mode": 33188,
      "old_path": "kernel/fork.c",
      "new_id": "001b18473a07aed55ee7e5e6abf6f1f572bba100",
      "new_mode": 33188,
      "new_path": "kernel/fork.c"
    },
    {
      "type": "modify",
      "old_id": "a2214c64ed3cd04dceaed7a579f593852e458df1",
      "old_mode": 33188,
      "old_path": "mm/page_alloc.c",
      "new_id": "248851d1fc868b8a6228a3d75ac6a3085cdeb2aa",
      "new_mode": 33188,
      "new_path": "mm/page_alloc.c"
    },
    {
      "type": "modify",
      "old_id": "61f0e6db909bbf0a7016d60f4b58a4c4bd3c0dba",
      "old_mode": 33188,
      "old_path": "scripts/Makefile.gcc-plugins",
      "new_id": "060d2cb373dbe3fe788b7ad01b7868eca3b73166",
      "new_mode": 33188,
      "new_path": "scripts/Makefile.gcc-plugins"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "ff1939b804aefe75631431b45e6f7ce80cc133f3",
      "new_mode": 33188,
      "new_path": "scripts/gcc-plugins/latent_entropy_plugin.c"
    }
  ]
}
