Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1658397yba; Thu, 9 May 2019 21:49:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHaA86WMAHrph+vL2ulCif+nwEet44K/a/iCJxab8ogAgB8UNi/NdQiMLulYgDtuC4oUDo X-Received: by 2002:a65:5106:: with SMTP id f6mr11170150pgq.253.1557463757168; Thu, 09 May 2019 21:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557463757; cv=none; d=google.com; s=arc-20160816; b=Ro9o4mCusICrVD76VTnZ5n7/YxpjAnJRQHuTlzvHKpCGgcJAE6SiMMmzdJVxOSyZx7 2UspbWq9DF5sTbWGUARnXmwt7othxdSO44ji2rBKCn39cnm660BgaxFbIIsNbmnftNyF OR6MK0YVLHpXhqTqO/zdsyP0YiwniJgLbw40WmXVuReRVjIErVNVdkWTnmtlA4MvjExG LHLeAVDsMC02OVI7kniyKgrpMq5pg+f3pIruSB7PTQbQng4ew0hYmDYoRHW8iqB/+ajT 7yj+xR6HqUQas/M5g2OVGvwCLmahGo+LbLDXA7iHE4CIrWWQhcp1DQEkCZEi8GHxC6ZW hLKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xvneL+tleAZug+cm73ok0sRVVSDLg417J9gTpEjzm0Y=; b=OrE8S6qlqAFzBK7JBdHOq5/ClXk9rlgAg3Sra/eI1RrEfhd+kQrBLsDtzctNpauo7d l7tHebFuE67hRJ/s1eFBaQGZHr3d8q4Vnvc8+umP7KiLzm2WhFZcKqf/lxtv70PI4B5u 6cN1VBwEuB4X6YN2/SxriWkERq7GFfhNmT5mnNMfEWdjMms89rLo+4m0AQ/3SQ5+I1mZ FCUPNC+U1r60S3Jzl2820sfbl+7lPans4NkcANo2ylRWeeOXZ/qXgTjkrkxPmochzVDc jxVpc5CPcAaWkxoRrSmqRkLPVCYlX/3hg2wZORrz7XZ91FHdWadquTrPY08spFQwcpKu J7aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OFGOE2Nw; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si6304884pla.371.2019.05.09.21.48.47; Thu, 09 May 2019 21:49:17 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OFGOE2Nw; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726883AbfEJEcG (ORCPT + 99 others); Fri, 10 May 2019 00:32:06 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:43684 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbfEJEcG (ORCPT ); Fri, 10 May 2019 00:32:06 -0400 Received: by mail-pl1-f196.google.com with SMTP id n8so2192650plp.10; Thu, 09 May 2019 21:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xvneL+tleAZug+cm73ok0sRVVSDLg417J9gTpEjzm0Y=; b=OFGOE2NwOn/bcY8miPOcXwpkHA80Ku8G4fyzOGykVhmR/QDaMsnCcwbIDimS7JTF5x gvMg+htASqUGwslWKLMbU1xXdsQaVUcA/xPqXJ0j45BYvpJ3onYF5mDvzaoz3gA3C77B ++l12pVN+QFnZjgx39cid1yMH+P3KT0xaTRuupjJwhqpQ78pa3bVqh+Gj22blHzFubzH YtdQ7BQvuXX8czCJXHl9ref8MygU9ec9G0beZY9SNC55RzYgkGmMTDmHFBliUjOnie/Y rT9nhRDFk346t/w2nxRdrAq6xrkYiBzWcghocJe6EOAGwJeDfMlTeLC4nNAuKqMZeMcw bPpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xvneL+tleAZug+cm73ok0sRVVSDLg417J9gTpEjzm0Y=; b=Y0UEUUxtaCQH2cnMxENfztawyFlKdgExduujyJU56aewSxayhN6h2+Iik42pZ4fYfL G0USklTwMFTE7STym7HUymEKZ51r+7KgYpQUhl96Poao7bgbSIx+gaie83KPEenjx2i/ u4fCjXrxKqHoJnIpD/9lYMHtE/dTxHElFr/wl5UnIvlIydVIgF7vTwTuA0fuei6V+www 9MQrgRc6sqiPzieAZ9uWCMSpjV5GU63lnIysNmRiQ1x1fL5Z1WI6UC0GdV+UbrZWVZFu 7oWzQ4bYZnr+1U383eFNEKF4Y85JTOfw3n5h729ZM9fRvBhR7bLq9++uMTQa5Lx4icr7 hJtQ== X-Gm-Message-State: APjAAAX6vavaKS69kYb9/SY2+CDXGY43dwl+lDR2ITe7EpIbVcCsCRPz iBW8A0K2e2ZGorGmiM7w1zY= X-Received: by 2002:a17:902:10c:: with SMTP id 12mr10524545plb.61.1557462725544; Thu, 09 May 2019 21:32:05 -0700 (PDT) Received: from localhost ([39.7.15.25]) by smtp.gmail.com with ESMTPSA id y17sm5555133pfb.161.2019.05.09.21.32.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 May 2019 21:32:03 -0700 (PDT) Date: Fri, 10 May 2019 13:32:00 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Linus Torvalds , Andy Shevchenko , Rasmus Villemoes , "Tobin C . Harding" , Michal Hocko , Sergey Senozhatsky , Steven Rostedt , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Russell Currey , Christophe Leroy , Stephen Rothwell , Heiko Carstens , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Martin Schwidefsky Subject: Re: [PATCH] vsprintf: Do not break early boot with probing addresses Message-ID: <20190510043200.GC15652@jagdpanzerIV> References: <20190509121923.8339-1-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190509121923.8339-1-pmladek@suse.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (05/09/19 14:19), Petr Mladek wrote: > 1. Report on Power: > > Kernel crashes very early during boot with with CONFIG_PPC_KUAP and > CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG > > The problem is the combination of some new code called via printk(), > check_pointer() which calls probe_kernel_read(). That then calls > allow_user_access() (PPC_KUAP) and that uses mmu_has_feature() too early > (before we've patched features). With the JUMP_LABEL debug enabled that > causes us to call printk() & dump_stack() and we end up recursing and > overflowing the stack. Hmm... hmm... PPC does an .opd-based symbol dereference, which eventually probe_kernel_read()-s. So early printk(%pS) will do printk(%pS) dereference_function_descriptor() probe_kernel_address() dump_stack() printk(%pS) dereference_function_descriptor() probe_kernel_address() dump_stack() printk(%pS) ... I'd say... that it's not vsprintf that we want to fix, it's the idea that probe_kernel_address() can dump_stack() on any platform. On some archs probe_kernel_address()->dump_stack() is going nowhere: dump_stack() does probe_kernel_address(), which calls dump_stack(), which calls printk(%pS)->probe_kernel_address() again and again, and again. -ss