Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752440AbbHWMYW (ORCPT ); Sun, 23 Aug 2015 08:24:22 -0400 Received: from mail-ig0-f173.google.com ([209.85.213.173]:34482 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbbHWMYT (ORCPT ); Sun, 23 Aug 2015 08:24:19 -0400 MIME-Version: 1.0 X-Originating-IP: [122.106.150.15] Date: Sun, 23 Aug 2015 22:24:18 +1000 Message-ID: Subject: RE: Bad Reference Semantics in PIDs Controller. From: Aleksa Sarai To: Tejun Heo Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 729 Lines: 16 It turns out that, actually, the can_attach(), cancel_attach() and attach() code is broken -- we're incrementing a ref on the old_css of a task in can_attach(). Then we decrement the ref on a *different* css (because the task has been migrated). This is clearly a bad thing. Should we make cgroup_migrate() deal with the accounting for us (by getting it to grab a ref before can_attach() and dropping it after the attach succeeds or fails?). -- Aleksa Sarai (cyphar) www.cyphar.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/