Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1025254ybl; Sun, 1 Dec 2019 18:28:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwtnn6giRxBwddkwKtvlf9pbW1h1TbYG47OzY0T6a3NpRMvpGXxeTTLQts2igCgBxOtkFmB X-Received: by 2002:a50:f70c:: with SMTP id g12mr8108672edn.142.1575253717666; Sun, 01 Dec 2019 18:28:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575253717; cv=none; d=google.com; s=arc-20160816; b=rW2bWvuOOzJos+CKj77cxDSi208cIMuc1BgjG6rjBOxRMHLAHslvzYUKqzyYrdQaSS V6nr04iaUvJCzzI+AY6E/Bp6m1rei5EiPmuvbUSTTAPUDPw30OBk8sX8e7AQ4auB+1z0 VRaFHscxztADQR8opzqnCKJuDvhJXyzszfwgbV0qoXPj6/nQ1KDla/Lca2mWRnS3iFm8 K4lv9E8/1Qm/ecDtdEFijCWjVLfD0E5qD4CfdKevXVR6+OW47tUKobnccwBnAecZO+Hr 43zBzQ+cV9Hfr2EdfkWY07l1c72RAgmDv58frAGkUE3/qYDr1uKGJKbnk9U7LDmezrfR d0Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=LsL4Fb10KT+/55x/ZaUiBLM0zodQoYWikMd8Zj5n3Bc=; b=uSx5ibpt52zwKhGTffkih+QPl28rAzsSPYnlrwbxsh7wlDVslvRtFM63Ur8/0QcxmC d4LwBND9I48+CjntdXth2FclFyI5d2e2RtTZUa7DkOvfS0CGcXGxYHTsTQcg28WMVCxY aIu0iFPDLD6tsWmGexvNP38O19rFENEjg67v8hC0inV/UrYB5Tj2FgSkv0EN6+remrzp YVb26jGaAfVUFiXnbRqhV9AkYS+OFrsfVJONDH0EQg7+qveA97RQuHo/x117Vk0dw5nZ KNkbMVBrK/S2KhlOFm6op5sJh7fl3EKFeRonHXdjvMpuIApe7ILtaugbDsh9FX/lMtZR nR4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="wY1eP/G6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 24si22535220eje.293.2019.12.01.18.28.13; Sun, 01 Dec 2019 18:28:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="wY1eP/G6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727368AbfLBCYm (ORCPT + 99 others); Sun, 1 Dec 2019 21:24:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:58228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727285AbfLBCYm (ORCPT ); Sun, 1 Dec 2019 21:24:42 -0500 Received: from devnote (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 366E720833; Mon, 2 Dec 2019 02:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575253481; bh=bCX0zLHnRAYKwu7QjN9Wg2R3BkNbHuG8UU52n0LnOyY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=wY1eP/G6XCEBWo2esoz0bpaBpVcbJ7JNs6DjR5T1KSAMXzhPEDD/j7ZDlm2tL1rxk ay8nBxsUKj+DKIuVOEryFmfxeAM+5y9P5XOJEcTG8xjqpcwa9cFHxwgKXSzgGYhGiJ EHhcg33opZ1+HsljQX96NlD+1kcnE3UBYVwEPxO0= Date: Mon, 2 Dec 2019 11:24:37 +0900 From: Masami Hiramatsu To: Anders Roxell Cc: paulmck@kernel.org, joel@joelfernandes.org, "Naveen N . Rao" , Anil S Keshavamurthy , David Miller , Masami Hiramatsu , Linux Kernel Mailing List Subject: Re: next-20191122: qemu arm64: WARNING: suspicious RCU usage Message-Id: <20191202112437.b7dc520eeea0690623263ad5@kernel.org> In-Reply-To: References: X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Sorry for replying so late. On Fri, 22 Nov 2019 22:43:56 +0100 Anders Roxell wrote: > Hi, > > I'm seeing the following warning when I'm booting an arm64 allmodconfig > kernel [1] on linux-next; tag next-20191122, is this anything you've seen > before ? > > The code seems to have introduced a long time ago and the warning was > added recently 28875945ba98 ("rcu: Add support for consolidated-RCU > reader checking"). I've never seen this but the warning itself is justified. struct kprobe *get_kprobe(void *addr) { struct hlist_head *head; struct kprobe *p; head = &kprobe_table[hash_ptr(addr, KPROBE_HASH_BITS)]; hlist_for_each_entry_rcu(p, head, hlist) { <---- this cause the warning if (p->addr == addr) return p; } return NULL; } The kprobe_table itself is protected by kprobe_mutex OR rcu. If the caller locks the kprobe_mutex, we can safely access the hash table, this is what the register_kprobe does. If not, the caller must disable preemption, this happens when a kprobe (breakpoint) is hit. Thus, the kernel itself is safe, but it should be fixed. Thank you, -- Masami Hiramatsu