)]}'
{
  "commit": "b1ab41c4943008375c149a63602d7407f61de5b2",
  "tree": "365413de6ebbfee39aa90c069b7be14a4b9a699e",
  "parents": [
    "b52a834892f17b6c54c34ab65f1fad1a9229e764"
  ],
  "author": {
    "name": "Ingo Molnar",
    "email": "mingo@elte.hu",
    "time": "Fri Jun 02 15:44:58 2006 +0200"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@g5.osdl.org",
    "time": "Fri Jun 02 11:21:10 2006 -0700"
  },
  "message": "[PATCH] slab.c: fix offslab_limit bug\n\nmm/slab.c\u0027s offlab_limit logic is totally broken.\n\nFirstly, \"offslab_limit\" is a global variable while it should either be\ncalculated in situ or should be passed in as a parameter.\n\nSecondly, the more serious problem with it is that the condition for\ncalculating it:\n\n               if (!(OFF_SLAB(sizes-\u003ecs_cachep))) {\n                       offslab_limit \u003d sizes-\u003ecs_size - sizeof(struct slab);\n                       offslab_limit /\u003d sizeof(kmem_bufctl_t);\n\nis in total disconnect with the condition that makes use of it:\n\n               /* More than offslab_limit objects will cause problems */\n               if ((flags \u0026 CFLGS_OFF_SLAB) \u0026\u0026 num \u003e offslab_limit)\n                       break;\n\nbut due to offslab_limit being a global variable this breakage was\nhidden.\n\nUp until lockdep came along and perturbed the slab sizes sufficiently so\nthat the first off-slab cache would still see a (non-calculated) zero\nvalue for offslab_limit and would panic with:\n\n  kmem_cache_create: couldn\u0027t create cache size-512.\n\n  Call Trace:\n   [\u003cffffffff8020a5b9\u003e] show_trace+0x96/0x1c8\n   [\u003cffffffff8020a8f0\u003e] dump_stack+0x13/0x15\n   [\u003cffffffff8022994f\u003e] panic+0x39/0x21a\n   [\u003cffffffff80270814\u003e] kmem_cache_create+0x5a0/0x5d0\n   [\u003cffffffff80aced62\u003e] kmem_cache_init+0x193/0x379\n   [\u003cffffffff80abf779\u003e] start_kernel+0x17f/0x218\n   [\u003cffffffff80abf263\u003e] _sinittext+0x263/0x26a\n\n  Kernel panic - not syncing: kmem_cache_create(): failed to create slab `size-512\u0027\n\nPaolo Ornati\u0027s config on x86_64 managed to trigger it.\n\nThe fix is to move the calculation to the place that makes use of it.\nThis also makes slab.o 54 bytes smaller.\n\nBtw., the check itself is quite silly. Its intention is to test whether\nthe number of objects per slab would be higher than the number of slab\ncontrol pointers possible. In theory it could be triggered: if someone\ntried to allocate 4-byte objects cache and explicitly requested with\nCFLGS_OFF_SLAB. So i kept the check.\n\nOut of historic interest i checked how old this bug was and it\u0027s\nancient, 10 years old! It is the oldest hidden and then truly triggering\nbugs i ever saw being fixed in the kernel!\n\nSigned-off-by: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d31a06bfbea5c78998e3c68a5a484b98b3e4579f",
      "old_mode": 33188,
      "old_path": "mm/slab.c",
      "new_id": "f1b644eb39d816b3865400caf8d589d458756a17",
      "new_mode": 33188,
      "new_path": "mm/slab.c"
    }
  ]
}
