From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757441AbdKGTdB (ORCPT ); Tue, 7 Nov 2017 14:33:01 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:49461 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753215AbdKGTdA (ORCPT ); Tue, 7 Nov 2017 14:33:00 -0500 X-Google-Smtp-Source: ABhQp+Rn0RONgZz65s87TIjQixaMtIOHYjRl2TESksh8eI5B0AALF0xCCuuQt1XeBXY2peJIwxLgWg== Date: Tue, 7 Nov 2017 11:32:57 -0800 From: Tejun Heo To: Shaohua Li Cc: LKML , Jens Axboe , Andrew Morton , Ingo Molnar , Dmitry Vyukov Subject: Re: [PATCH V2] kthread: zero the kthread data structure Message-ID: <20171107193257.GB4164960@devbig577.frc2.facebook.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 07, 2017 at 11:09:50AM -0800, Shaohua Li wrote: > kthread() could bail out early before we initialize blkcg_css (if the > kthread is killed very early. Please see xchg() statement in kthread()), > which confuses free_kthread_struct. Instead of moving the blkcg_css > initialization early, we simply zero the whole 'self' data structure, > which doesn't sound much overhead. > > Reported-by: syzbot > Fixes: 05e3db95ebfc ("kthread: add a mechanism to store cgroup info") > Cc: Andrew Morton > Cc: Ingo Molnar > Cc: Tejun Heo > Cc: Dmitry Vyukov > Signed-off-by: Shaohua Li Acked-by: Tejun Heo Thanks. -- tejun