Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp743379imm; Thu, 13 Sep 2018 07:07:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZm1YTCTkQm+ehPf7gfibmCvQ1B6rYzjvbEmX28AsCtPfvhVO6w32ZrpCc2RGjrn7jeYXi+ X-Received: by 2002:a63:6485:: with SMTP id y127-v6mr7285290pgb.393.1536847665787; Thu, 13 Sep 2018 07:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847665; cv=none; d=google.com; s=arc-20160816; b=x0ddsOckfry4VbjZH/xIznKv/x0wYCNz36i6LDQmyei9D3s5culjmO4UiftFXJHHD4 tiPbPzPmufW8355QLjIPMPnThfEBay2o+NsC+6zxfyGfm/5d1tPakZRNjKDw4T29sRZB z1giGBCxr0Hrdz3aP+K1gHSYZEeuEIFGbsglp0WZ42XyDiC9cpSzfoIHjNR6mAgwc3de cykpGUkRfvpno6s3JxgIxckSwptXLl/BC8K1L/L7sNDf3gejKelmginRIIAujrFbQzj/ hYaQV1mRx0daBH1zZXZ2FPnTA1wkOjS+lDDaLhFr0l8kqWyuO55IywdediJ30juNzPzd DMgg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=eILBJnmElSBUFoUVEHrL+AQJCNGwi/IKnPvgxt/enCo=; b=YQhVk0AS3jy34gKOHzjMXaWX7gVLeQIlL8nWB4/CFy7k0E5el9rRPVwdsEc0+oum7t AuuEROFScrOIFbVB0A+ApUXASXeUYSgubkitHTkoi4vhpImvqMwDRZ5oSAGs4R6i6AI8 j4rpJkPZP/TZbna9BWkkZZof1QAJZdd4u0EQrYRq5hXkoK7VsQwvSBTiCi3eeoHrXbiP alztEAhcpIzUxQqhnMo4PBn4Yw/wpBBpVpvh0h7m4TWVSh06j7LwVZaqLxz4QjLCPlRi 1zfAOGQxlG29fLBiTwOWdc84HYl6mEXfNEO4lGITmA1BePEBvApVVli1JWrmB5R3F+NE 0XEQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d128-v6si4310767pfc.211.2018.09.13.07.07.29; Thu, 13 Sep 2018 07:07:45 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731866AbeIMTQm (ORCPT + 99 others); Thu, 13 Sep 2018 15:16:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35666 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729959AbeIMTQm (ORCPT ); Thu, 13 Sep 2018 15:16:42 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9631ED36; Thu, 13 Sep 2018 14:07:01 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Joel Fernandes (Google)" , Thomas Gleixner , Waiman Long , Yang Shi , kernel-team@android.com, Arnd Bergmann , astrachan@google.com Subject: [PATCH 4.18 190/197] debugobjects: Make stack check warning more informative Date: Thu, 13 Sep 2018 15:32:19 +0200 Message-Id: <20180913131849.159651216@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joel Fernandes (Google) commit fc91a3c4c27acdca0bc13af6fbb68c35cfd519f2 upstream. While debugging an issue debugobject tracking warned about an annotation issue of an object on stack. It turned out that the issue was due to the object in concern being on a different stack which was due to another issue. Thomas suggested to print the pointers and the location of the stack for the currently running task. This helped to figure out that the object was on the wrong stack. As this is general useful information for debugging similar issues, make the error message more informative by printing the pointers. [ tglx: Massaged changelog ] Signed-off-by: Joel Fernandes (Google) Signed-off-by: Thomas Gleixner Acked-by: Waiman Long Acked-by: Yang Shi Cc: kernel-team@android.com Cc: Arnd Bergmann Cc: astrachan@google.com Link: https://lkml.kernel.org/r/20180723212531.202328-1-joel@joelfernandes.org Signed-off-by: Greg Kroah-Hartman --- lib/debugobjects.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -360,9 +360,12 @@ static void debug_object_is_on_stack(voi limit++; if (is_on_stack) - pr_warn("object is on stack, but not annotated\n"); + pr_warn("object %p is on stack %p, but NOT annotated.\n", addr, + task_stack_page(current)); else - pr_warn("object is not on stack, but annotated\n"); + pr_warn("object %p is NOT on stack %p, but annotated.\n", addr, + task_stack_page(current)); + WARN_ON(1); }