From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF67DC4361B for ; Sun, 20 Dec 2020 11:48:02 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F75F22D50 for ; Sun, 20 Dec 2020 11:48:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F75F22D50 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1kqxBN-0005zr-5i; Sun, 20 Dec 2020 06:47:25 -0500 Received: from mout.gmx.net ([212.227.17.21]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kqxBK-0005zj-F8 for kernelnewbies@kernelnewbies.org; Sun, 20 Dec 2020 06:47:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608464840; bh=vlavoRuHUoWhBn+9pPCYr+LtbhxXVsL9XFXTo8drLEo=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=SUfSI4jB7cGVao65xid1AZJo2KmIxnSzLeCXleDk1yNfXRIiIhPYvSM5stJpPFwjv wvGZT/HXnE43fz85ueWU84Hk6XT8wRbYhYxV1/GRbRciBmMD9Exv1C7TwNMAPCj5jE yJH12un76BPqIelvYvfNK3uNrr7mEkX0ASQeJp5w= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ubuntu ([83.52.231.213]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MIwz4-1kWfPR48gU-00KPtQ; Sun, 20 Dec 2020 12:47:20 +0100 Date: Sun, 20 Dec 2020 12:47:08 +0100 From: John Wood To: kernelnewbies@kernelnewbies.org Subject: Re: [PATCH 0/4] Help to debug spinlocks Message-ID: <20201220114708.GA11045@ubuntu> References: <20201219114640.63024-1-john.wood@gmx.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201219114640.63024-1-john.wood@gmx.com> X-Provags-ID: V03:K1:9RAk24ysxCUWiXzOCM2AkiRr6fk9ZMgIYziUqS8iyhJfTGWGd88 BEZaa7h/0tMWg0la2OtmUK+b9GLTJVNJlhmr1HUBU19J+23WZ+FWEyQIpFjOHcZWiMqcw58 p4MEK+727LZ/JrykqIt5ojwUrEGh7DjT4j4i1pKr9md/w5Xhxctfm32oWA6abBDW0I5XcwD wHfeCd0cINIdoweIM13BQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Cv2QTkEyF10=:wvB6sTS/NDUWjmlMZXIS4o X/rwmjcFv973jKju4a3Yqgmylc5geKGresfKZvjVTba29gAOSRyzXvPBkrbMx16ecvPxpDI3r 34Gb3LhzzNEsf2frM1ElnNdgPN91ZaFQzpcO78jTfQbWrI2t6AFS8u/ZGVaOWEQjut9cMAU5o LJyyKqZaQQP9rX26WnzjcQzrfmwyZc12kHjaJS8u0kwtltoL6zL9+qpe6sNcs86bVGcHHHz2g QPzrs6l8WJhavNLEchGd7J39zjzgaCGqKzcp3kIOS7axTukZ6RoO9CdWdM0zK2yM/ntPJkxat LR/5X6848fOf/OKykNj9vcneNvFqM9lFFCvC4bC+MD4F8j2M8aC3NUCm4IBTQ1Q0W1C6+a7h4 9Ik0A0DhS8Adh3SsYXU3AEjkJiYyxtyfoY1ki+4mmkGpKCfDoz7X0yUG9K8xc5T4Q/49GzQrH 7geCs7n43A9WkueZSEEK6MSFPhgCxL5mDa8U0tIikp0g0BASRv5Q28/kYPpU7sTSXLaHHAnQ5 +32vG9toN5tOTf276q/WGh+NGIlvarRErJbL+l+56fw6rRildWP5cDHhbNWI/YbPpb1H7JmDJ nV4JgrobBoP4ir/ssWJ+xtaYbLA2QOgCajY8PF1XFduWz/YocIGTqa0R2zSiRvL8xaZA5Hp7H oGvVovTOhFE6GufRqJbeh6on/bhE2k/vI91u438zoA0iU4VeBmAlhR6R6hx4jRMz0YBz862t7 ctLQO6G1/kzMS0W1oNaWPV9l9thF4d9r3iM6lvkmpvMXaNAp/YH+fWiV5+ylogn8O+DI6yxdg DoP3XR1YrFBI1GR+MFHuzqD/beCbXKmXjpS/9Oyk93/rVSBa3x3pbyxKCAsDYOhx01SiVnogu XtwUdMzMjyr9CLfcyGWw== Cc: John Wood X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Sat, Dec 19, 2020 at 12:46:37PM +0100, John Wood wrote: > Hi, > > I'm working in a new LSM to detect and mitigate any fork brute force > attack against vulnerable userspace processes. I'm testing the detection > method but I have found some problems that I think are related to locking > since the kernel gets stuck but not crashes. This work is a WIP to obtain > the v3 version. The mitigation, documentation and fine tunning detection > are under construction. > > My problem is that I don't be able to find the cause of this behaviour and > any help would be greatly appreciated. I think that I have found the cause of the problem. I acquired the brute_stats_ptr_lock in the task_fatal_signal hook without disable interrupts. Then, the task_free hook was call from an IRQ context and tried to acquire the same lock in a write state. This cause a deadlock. Thanks anyway, John Wood _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies