From: Ian Jackson Subject: [PATCH 0/3] libxl: Fix deadlock with pygrub Date: Mon, 24 Feb 2014 14:19:12 +0000 Message-ID: <1393251555-22418-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: George Dunlap , Ian Campbell , M A Young List-Id: xen-devel@lists.xenproject.org Thanks to Michael Young for reporting this, and my apologies for introducing this bug. 1/3 libxl: Fix libxl_postfork_child_noexec deadlock etc. 2/3 libxl: Hold the atfork lock while closing carefd 3/3 libxl: Fix carefd lock leak in save callout Patch 1 is the actual bugfix. The bug is IMO clearly a blocker for 4.4 so the patch should go in if it is correct. I have checked that it seems to fix the problem for me. Patches 2 and 3 are other theoretical locking bugs I discovered while looking for the cause of the pygrub deadlock. I haven't tried to construct test cases that might exercise these bugs; doing so would be quite difficult. The atfork carefd race (patch 2) might be relevant to callers which are multithreaded and also call libxl_postfork_child_noexec. libvirt does not make any such call. xl is single-threaded. I haven't investigated other toolstacks, but the race is theoretical rather than observed. The carefd lock leak (patch 3) is obvious but theoretical except in deeply pathological situations. I don't think it's worth adding risk to 4.4 to fix it. So I think patch 1 should go into 4.4.0 after review. 2-3 should wait for 4.4.1 (coming via unstable in the usual way).