From patchwork Wed Jul 18 07:46:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 10110 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0F41E23E23 for ; Wed, 18 Jul 2012 07:48:36 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id BD837A18043 for ; Wed, 18 Jul 2012 07:48:35 +0000 (UTC) Received: by yhpp61 with SMTP id p61so1385746yhp.11 for ; Wed, 18 Jul 2012 00:48:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=AKtaggEp0//HugoVcoqG6GFuUY99PP2TDDU6oOQ3m9I=; b=Kj5pMDbsK13U2O8zxVYW0vm7qMuoY8zHTtHsBgRnMwKQsJ1lMJSg2GnUo635Gl/Ach R6FjOadHpB829qjS2R/bFXTnUEN/HFYzlThwxOwDQhoIiytcZ5b8RhpE/93pS4y6M1Vn GWubI/xcY7LH33Wo4nYPbOArs1M0znKN5me0QARliPZoO9NuuoJz0wMhILwIARs8Nl9A +H6KC6UkVm7JVaMUJwkaUu2ugDtyfPDtESN8CXBPE/4ZatA7XGXUz45zgN13P+fyMH2B E+FUS3MOogvyMiDu6pfi5y7uQGlwcwV4fmYCZHHXXeeqi2B4tgJuEcavTOW3X+jxP7ER hC2A== Received: by 10.50.163.99 with SMTP id yh3mr1042760igb.53.1342597714903; Wed, 18 Jul 2012 00:48:34 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.241.2 with SMTP id lc2csp28325ibb; Wed, 18 Jul 2012 00:48:33 -0700 (PDT) Received: by 10.236.75.232 with SMTP id z68mr4577199yhd.90.1342597713532; Wed, 18 Jul 2012 00:48:33 -0700 (PDT) Received: from mail-yx0-f178.google.com (mail-yx0-f178.google.com [209.85.213.178]) by mx.google.com with ESMTPS id y16si8094011anl.179.2012.07.18.00.48.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jul 2012 00:48:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.213.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by yenl6 with SMTP id l6so1531644yen.37 for ; Wed, 18 Jul 2012 00:48:33 -0700 (PDT) Received: by 10.66.89.168 with SMTP id bp8mr2782439pab.50.1342597712872; Wed, 18 Jul 2012 00:48:32 -0700 (PDT) Received: from localhost (c-71-204-165-222.hsd1.ca.comcast.net. [71.204.165.222]) by mx.google.com with ESMTPS id pe2sm15697526pbc.59.2012.07.18.00.48.30 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jul 2012 00:48:32 -0700 (PDT) From: Anton Vorontsov To: Greg Kroah-Hartman , Kees Cook , Colin Cross , Tony Luck Cc: Steven Rostedt , John Stultz , arve@android.com, Rebecca Schultz Zavin , Marco Stornelli , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linaro-kernel@lists.linaro.org, patches@linaro.org, kernel-team@android.com Subject: [PATCH] pstore/ram: Mark ramoops_pstore_write_buf() as notrace Date: Wed, 18 Jul 2012 00:46:18 -0700 Message-Id: <1342597578-31227-1-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmUj/J51XGD1BGJZ+RkcfpxgJOJft/bHwhu0P9jV99VAprLaoEaS7yKaF4M78NWgkdWcWnZ write_buf() should be marked as notrace, otherwise it is prone to recursion. Though, yet the issue is never triggered in real life, because we run inside the function tracer, where ftrace does its own recurse protection. But it's still no good, plus soon we might switch to our own tracer ops, and then the issue will be fatal. So, let's fix it. Signed-off-by: Anton Vorontsov --- fs/pstore/ram.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 0b311bc..b86b2b7 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #define RAMOOPS_KERNMSG_HDR "====" @@ -181,12 +182,11 @@ static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz) return len; } - -static int ramoops_pstore_write_buf(enum pstore_type_id type, - enum kmsg_dump_reason reason, - u64 *id, unsigned int part, - const char *buf, size_t size, - struct pstore_info *psi) +static int notrace ramoops_pstore_write_buf(enum pstore_type_id type, + enum kmsg_dump_reason reason, + u64 *id, unsigned int part, + const char *buf, size_t size, + struct pstore_info *psi) { struct ramoops_context *cxt = psi->data; struct persistent_ram_zone *prz = cxt->przs[cxt->dump_write_cnt];