)]}'
{
  "commit": "bbded2a42f66cd31205bc5da314bb4008dc85c25",
  "tree": "8124495e7db90058f13e09618d2b85dad85f6d33",
  "parents": [
    "b3383bb299e7d6e71879123c60f83cf5c97942da"
  ],
  "author": {
    "name": "Reinette Chatre",
    "email": "reinette.chatre@intel.com",
    "time": "Tue Mar 17 09:26:45 2020 -0700"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Tue Apr 21 09:06:44 2020 +0200"
  },
  "message": "x86/resctrl: Fix invalid attempt at removing the default resource group\n\ncommit b0151da52a6d4f3951ea24c083e7a95977621436 upstream.\n\nThe default resource group (\"rdtgroup_default\") is associated with the\nroot of the resctrl filesystem and should never be removed. New resource\ngroups can be created as subdirectories of the resctrl filesystem and\nthey can be removed from user space.\n\nThere exists a safeguard in the directory removal code\n(rdtgroup_rmdir()) that ensures that only subdirectories can be removed\nby testing that the directory to be removed has to be a child of the\nroot directory.\n\nA possible deadlock was recently fixed with\n\n  334b0f4e9b1b (\"x86/resctrl: Fix a deadlock due to inaccurate reference\").\n\nThis fix involved associating the private data of the \"mon_groups\"\nand \"mon_data\" directories to the resource group to which they belong\ninstead of NULL as before. A consequence of this change was that\nthe original safeguard code preventing removal of \"mon_groups\" and\n\"mon_data\" found in the root directory failed resulting in attempts to\nremove the default resource group that ends in a BUG:\n\n  kernel BUG at mm/slub.c:3969!\n  invalid opcode: 0000 [#1] SMP PTI\n\n  Call Trace:\n  rdtgroup_rmdir+0x16b/0x2c0\n  kernfs_iop_rmdir+0x5c/0x90\n  vfs_rmdir+0x7a/0x160\n  do_rmdir+0x17d/0x1e0\n  do_syscall_64+0x55/0x1d0\n  entry_SYSCALL_64_after_hwframe+0x44/0xa9\n\nFix this by improving the directory removal safeguard to ensure that\nsubdirectories of the resctrl root directory can only be removed if they\nare a child of the resctrl filesystem\u0027s root _and_ not associated with\nthe default resource group.\n\nFixes: 334b0f4e9b1b (\"x86/resctrl: Fix a deadlock due to inaccurate reference\")\nReported-by: Sai Praneeth Prakhya \u003csai.praneeth.prakhya@intel.com\u003e\nSigned-off-by: Reinette Chatre \u003creinette.chatre@intel.com\u003e\nSigned-off-by: Borislav Petkov \u003cbp@suse.de\u003e\nTested-by: Sai Praneeth Prakhya \u003csai.praneeth.prakhya@intel.com\u003e\nCc: stable@vger.kernel.org\nLink: https://lkml.kernel.org/r/884cbe1773496b5dbec1b6bd11bb50cffa83603d.1584461853.git.reinette.chatre@intel.com\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6a92a59a5884902f6c861b8c9fee9af91f006ed8",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/cpu/resctrl/rdtgroup.c",
      "new_id": "20856d80dce3b96e8643371fb949822ee0e9199a",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/cpu/resctrl/rdtgroup.c"
    }
  ]
}
