From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH] cgroups: fix a css_set not found bug in cgroup_attach_proc Date: Thu, 15 Dec 2011 13:23:29 -0800 Message-ID: <20111215212329.GH32002@google.com> References: <1323977803-5385-1-git-send-email-msb@chromium.org> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=hwazH1c5phDOrgAy1gijWMRqe2H6CYz2845Y5FOYUu0=; b=U5fS3u0czor0NT94GAdhI46wMbiLcSKU89sstvEoJFsowErfTaAGSfW+OuelkBsPZ1 DZtAkxe3ENiv0mdiYUODkthYUTMolNlnUBf5seNxtl4C7otzTJav55vsyDJ6gDtRGXQ3 GprucTYJCcaY5gjQWAiSDIDzncGFkdq6U1IsE= Content-Disposition: inline In-Reply-To: <1323977803-5385-1-git-send-email-msb-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mandeep Singh Baines Cc: Li Zefan , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, KAMEZAWA Hiroyuki , Frederic Weisbecker , Oleg Nesterov , Andrew Morton , Paul Menage , Olof Johansson On Thu, Dec 15, 2011 at 11:36:43AM -0800, Mandeep Singh Baines wrote: > There is a BUG when migrating a PF_EXITING proc. Since css_set_prefetch() > is not called for the PF_EXITING case, find_existing_css_set() will return > NULL inside cgroup_task_migrate() causing a BUG. > > This bug is easy to reproduce. Create a zombie and echo its pid to > cgroup.procs. > > $ cat zombie.c > \#include > > int main() > { > if (fork()) > pause(); > return 0; > } > $ > > We are hitting this bug pretty regularly on ChromeOS. > > This bug is already fixed by Tejun Heo's cgroup patchset which is > targetted for the next merge window: > > https://lkml.org/lkml/2011/11/1/356 > > I've create a smaller patch here which just fixes this bug so that a > fix can be merged into the current release and stable. Looks safe to me. Li? Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe cgroups" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759520Ab1LOVXg (ORCPT ); Thu, 15 Dec 2011 16:23:36 -0500 Received: from mail-vx0-f174.google.com ([209.85.220.174]:61929 "EHLO mail-vx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754146Ab1LOVXf (ORCPT ); Thu, 15 Dec 2011 16:23:35 -0500 Date: Thu, 15 Dec 2011 13:23:29 -0800 From: Tejun Heo To: Mandeep Singh Baines Cc: Li Zefan , linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org, cgroups@vger.kernel.org, stable@kernel.org, KAMEZAWA Hiroyuki , Frederic Weisbecker , Oleg Nesterov , Andrew Morton , Paul Menage , Olof Johansson Subject: Re: [PATCH] cgroups: fix a css_set not found bug in cgroup_attach_proc Message-ID: <20111215212329.GH32002@google.com> References: <1323977803-5385-1-git-send-email-msb@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1323977803-5385-1-git-send-email-msb@chromium.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 15, 2011 at 11:36:43AM -0800, Mandeep Singh Baines wrote: > There is a BUG when migrating a PF_EXITING proc. Since css_set_prefetch() > is not called for the PF_EXITING case, find_existing_css_set() will return > NULL inside cgroup_task_migrate() causing a BUG. > > This bug is easy to reproduce. Create a zombie and echo its pid to > cgroup.procs. > > $ cat zombie.c > \#include > > int main() > { > if (fork()) > pause(); > return 0; > } > $ > > We are hitting this bug pretty regularly on ChromeOS. > > This bug is already fixed by Tejun Heo's cgroup patchset which is > targetted for the next merge window: > > https://lkml.org/lkml/2011/11/1/356 > > I've create a smaller patch here which just fixes this bug so that a > fix can be merged into the current release and stable. Looks safe to me. Li? Thanks. -- tejun