)]}'
{
  "commit": "730c586ad5228c339949b2eb4e72b80ae167abc4",
  "tree": "ab1d06260232b343bd1d2d7a5d0563500a1de915",
  "parents": [
    "2cb7878a3a4341d1faa208de962d66f0817d3e7a"
  ],
  "author": {
    "name": "Salman Qazi",
    "email": "sqazi@google.com",
    "time": "Thu Jun 04 15:20:39 2009 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Jun 04 15:20:39 2009 -0700"
  },
  "message": "drivers/char/mem.c: avoid OOM lockup during large reads from /dev/zero\n\nWhile running 20 parallel instances of dd as follows:\n\n  #!/bin/bash\n  for i in `seq 1 20`; do\n           dd if\u003d/dev/zero of\u003d/export/hda3/dd_$i bs\u003d1073741824 count\u003d1 \u0026\n  done\n  wait\n\non a 16G machine, we noticed that rather than just killing the processes,\nthe entire kernel went down.  Stracing dd reveals that it first does an\nmmap2, which makes 1GB worth of zero page mappings.  Then it performs a\nread on those pages from /dev/zero, and finally it performs a write.\n\nThe machine died during the reads.  Looking at the code, it was noticed\nthat /dev/zero\u0027s read operation had been changed by\n557ed1fa2620dc119adb86b34c614e152a629a80 (\"remove ZERO_PAGE\") from giving\nzero page mappings to actually zeroing the page.\n\nThe zeroing of the pages causes physical pages to be allocated to the\nprocess.  But, when the process exhausts all the memory that it can, the\nkernel cannot kill it, as it is still in the kernel mode allocating more\nmemory.  Consequently, the kernel eventually crashes.\n\nTo fix this, I propose that when a fatal signal is pending during\n/dev/zero read operation, we simply return and let the user process die.\n\nSigned-off-by: Salman Qazi \u003csqazi@google.com\u003e\nCc: Nick Piggin \u003cnickpiggin@yahoo.com.au\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\n[ Modified error return and comment trivially.  - Linus]\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8f05c38c2f0636c548e857218448556e8ecf76de",
      "old_mode": 33188,
      "old_path": "drivers/char/mem.c",
      "new_id": "65e12bca657cfa0ba14f842ce6b442411f68bca6",
      "new_mode": 33188,
      "new_path": "drivers/char/mem.c"
    }
  ]
}
