)]}'
{
  "commit": "0bfc96cb77224736dfa35c3c555d37b3646ef35e",
  "tree": "af5135c929ee8e1bdb38c306b2634dbc547d5189",
  "parents": [
    "577ebb374c78314ac4617242f509e2f5e7156649"
  ],
  "author": {
    "name": "Paolo Bonzini",
    "email": "pbonzini@redhat.com",
    "time": "Thu Jan 12 16:01:28 2012 +0100"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Sat Jan 14 15:07:24 2012 -0800"
  },
  "message": "block: fail SCSI passthrough ioctls on partition devices\n\nLinux allows executing the SG_IO ioctl on a partition or LVM volume, and\nwill pass the command to the underlying block device.  This is\nwell-known, but it is also a large security problem when (via Unix\npermissions, ACLs, SELinux or a combination thereof) a program or user\nneeds to be granted access only to part of the disk.\n\nThis patch lets partitions forward a small set of harmless ioctls;\nothers are logged with printk so that we can see which ioctls are\nactually sent.  In my tests only CDROM_GET_CAPABILITY actually occurred.\nOf course it was being sent to a (partition on a) hard disk, so it would\nhave failed with ENOTTY and the patch isn\u0027t changing anything in\npractice.  Still, I\u0027m treating it specially to avoid spamming the logs.\n\nIn principle, this restriction should include programs running with\nCAP_SYS_RAWIO.  If for example I let a program access /dev/sda2 and\n/dev/sdb, it still should not be able to read/write outside the\nboundaries of /dev/sda2 independent of the capabilities.  However, for\nnow programs with CAP_SYS_RAWIO will still be allowed to send the\nioctls.  Their actions will still be logged.\n\nThis patch does not affect the non-libata IDE driver.  That driver\nhowever already tests for bd !\u003d bd-\u003ebd_contains before issuing some\nioctl; it could be restricted further to forbid these ioctls even for\nprograms running with CAP_SYS_ADMIN/CAP_SYS_RAWIO.\n\nCc: linux-scsi@vger.kernel.org\nCc: Jens Axboe \u003caxboe@kernel.dk\u003e\nCc: James Bottomley \u003cJBottomley@parallels.com\u003e\nSigned-off-by: Paolo Bonzini \u003cpbonzini@redhat.com\u003e\n[ Make it also print the command name when warning - Linus ]\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a2c11f330872c9f72a7c6176bcedad1e6a56537c",
      "old_mode": 33188,
      "old_path": "block/scsi_ioctl.c",
      "new_id": "260fa80ef5750f80f4ebc1415d06abc992e18b8a",
      "new_mode": 33188,
      "new_path": "block/scsi_ioctl.c"
    },
    {
      "type": "modify",
      "old_id": "b4d57bb04c7253719ec437c7c1bd7c9e601d8f11",
      "old_mode": 33188,
      "old_path": "drivers/scsi/sd.c",
      "new_id": "c691fb50e6cbfe75deceddcdf744dc1301cc7d08",
      "new_mode": 33188,
      "new_path": "drivers/scsi/sd.c"
    },
    {
      "type": "modify",
      "old_id": "ca7b869508c7a92c1fa477f2f1f050f309bcec01",
      "old_mode": 33188,
      "old_path": "include/linux/blkdev.h",
      "new_id": "0ed1eb062313fdf237124d94a8efe24a8a7680fa",
      "new_mode": 33188,
      "new_path": "include/linux/blkdev.h"
    }
  ]
}
