From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939148AbdD0WjI (ORCPT ); Thu, 27 Apr 2017 18:39:08 -0400 Received: from mail-vk0-f48.google.com ([209.85.213.48]:34531 "EHLO mail-vk0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938547AbdD0WjB (ORCPT ); Thu, 27 Apr 2017 18:39:01 -0400 MIME-Version: 1.0 X-Originating-IP: [108.49.102.27] In-Reply-To: References: From: Paul Moore Date: Thu, 27 Apr 2017 18:38:54 -0400 Message-ID: Subject: Re: Boot regression caused by kauditd To: Cong Wang Cc: LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 27, 2017 at 5:45 PM, Cong Wang wrote: > On Thu, Apr 27, 2017 at 2:35 PM, Cong Wang wrote: >> On Thu, Apr 27, 2017 at 1:31 PM, Cong Wang wrote: >>> On Wed, Apr 26, 2017 at 2:20 PM, Paul Moore wrote: >>>> Thanks for the report, this is the only one like it that I've seen. >>>> I'm looking at the code in Linus' tree and I'm not seeing anything >>>> obvious ... looking at the trace above it appears that the problem is >>>> when get_net() goes to bump the refcount and the passed net pointer is >>>> NULL; unless I'm missing something, the only way this would happen in >>>> kauditd_thread() is if the auditd_conn.pid value is non-zero but the >>>> auditd_conn.net pointer is NULL. >>>> >>>> That shouldn't happen. >>>> >>> >>> Looking at the code that reads/writes the global auditd_conn, >>> I don't see how it even works with RCU+spinlock, RCU plays >>> with pointers and you have to make a copy as its name implies. >>> But it looks like you simply use RCU+spinlock as a traditional >>> rwlock, it doesn't work. >> >> The attached patch seems working for me, I tried to boot my >> VM for 4 times, so far no crash or warning. >> > > Or even better, save a memory allocation for reset path... I need to step away from my laptop for the evening so I can't give this a proper review until tomorrow (sending patches as attachments makes it difficult to review), but on quick glance I did notice a few small things I would like to see changed. However, since there is no normal commit description and sign-off, I'm guessing you sent these out as a suggestion and not a proper patch submission, yes/no? If that's the case, I'll work up a proper fix tomorrow and share it with you for comment/review, but if you were planning on sending a proper patch let me know and I'll wait until I see something in my inbox from you. -- paul moore www.paul-moore.com