From patchwork Mon Mar 6 21:55:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9607807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1513C60414 for ; Mon, 6 Mar 2017 22:58:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDB0E2846B for ; Mon, 6 Mar 2017 22:58:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE4A928481; Mon, 6 Mar 2017 22:58:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B2072846B for ; Mon, 6 Mar 2017 22:58:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753771AbdCFW6s (ORCPT ); Mon, 6 Mar 2017 17:58:48 -0500 Received: from mail-pg0-f41.google.com ([74.125.83.41]:35403 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753939AbdCFW6q (ORCPT ); Mon, 6 Mar 2017 17:58:46 -0500 Received: by mail-pg0-f41.google.com with SMTP id b129so71300899pgc.2 for ; Mon, 06 Mar 2017 14:58:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=x0gbZF4gD76rDrD3NvwXNf5Kg4/wxrRxenBUdLR3LXk=; b=nbuKJe+yupWcGi470ieJgRxj+iJ3rD68eFQV8wfr9Qsfr56+T4bZPhzYYTWGTphPeL VJ2uP/DylIpZvwm3zq4mMXDqT/OF3xxbk6bmdeufdD/I6AcoZh3jYE+0w0CN4vEujCXm Oh+EnIowjxdKmrpqOALNo0l12PVasVBHy1tiY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=x0gbZF4gD76rDrD3NvwXNf5Kg4/wxrRxenBUdLR3LXk=; b=og/VXGr1myGIP1Z1rpRJ0gdowcU3X9r4gYLCoqQZArz2t8Cq9r0eeyGkfmQfYKJCna Yok+iSYzB5dPEJTXtdWje9aGqZF3PNHjwzWApf8EwUw+nZN1tCVGJpZFh/LmcwTiUqWL jYdwFT80BS3g/KBxzu0WEi+Hu2hqVyA/8tVcAq4ea4+ML0KhyHU/E+Cwmooi4AuhWEY9 x9lOOZ+sF9JFDlsNOytc637FzzQ1W5jqGlnHZZTV5MXhcDZCRhjzrxIhWMhp1fQX6KZY wdqrMenHtdZLzDgN6b6JL32hfZcUQ/YAufZPtx7zYsHcdeOMNkJXnrdzT8T1WUSPAVVt CIvw== X-Gm-Message-State: AMke39koPqctGluaFavGUEzKqNfqHJX/Pq1mxrcZw19liQ3Eya9+IRL8g1O8kx/K2558IzU0 X-Received: by 10.99.170.70 with SMTP id x6mr23542138pgo.111.1488837336834; Mon, 06 Mar 2017 13:55:36 -0800 (PST) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id f21sm22725394pfj.111.2017.03.06.13.55.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 13:55:35 -0800 (PST) From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Kees Cook , stable@vger.kernel.org, Nobuhiro Iwamatsu , Qiuxu Zhuo , Ard Biesheuvel , Anton Vorontsov , Colin Cross , Tony Luck , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "Rafael J. Wysocki" , Len Brown , Matt Fleming , Nathan Fontenot , Pan Xinhui , Daniel Axtens , Paul Gortmaker , Geliang Tang , linuxppc-dev@lists.ozlabs.org, linux-acpi@vger.kernel.org, linux-efi@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH 01/18] pstore: Use dynamic spinlock initializer Date: Mon, 6 Mar 2017 13:55:15 -0800 Message-Id: <1488837332-71582-2-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488837332-71582-1-git-send-email-keescook@chromium.org> References: <1488837332-71582-1-git-send-email-keescook@chromium.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The per-prz spinlock should be using the dynamic initializer so that lockdep can correctly track it. Without this, under lockdep, we get a warning at boot that the lock is in non-static memory. Fixes: 109704492ef6 ("pstore: Make spinlock per zone instead of global") Fixes: 76d5692a5803 ("pstore: Correctly initialize spinlock and flags") Signed-off-by: Kees Cook Cc: stable@vger.kernel.org --- fs/pstore/ram_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index bc927e30bdcc..e11672aa4575 100644 --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -532,7 +532,7 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size, } /* Initialize general buffer state. */ - prz->buffer_lock = __RAW_SPIN_LOCK_UNLOCKED(buffer_lock); + raw_spin_lock_init(&prz->buffer_lock); prz->flags = flags; ret = persistent_ram_buffer_map(start, size, prz, memtype);