Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2205061yba; Fri, 10 May 2019 07:53:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyx1rVWOxvibxY8xVRFS/SIi4zbD8v4/fC9tyhwh6CiB8boxCYVadV9FXHoysS6xTwuuqkV X-Received: by 2002:aa7:8296:: with SMTP id s22mr15037943pfm.52.1557499983029; Fri, 10 May 2019 07:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557499983; cv=none; d=google.com; s=arc-20160816; b=og1+9dqnf3Ei0m1UlTTtry/e5I0JbnVNCl2rK8uTEw3WQkkq1GLGeFHkOoTP92szlq WDxk9LL6rHRw9B4yytLdWQfrXQneBjiMq+20+9/rN9j68zB4+5VDugq9qWiFQRLkL8ME JJlyZPTKLQ3B2yP5W0lzXAUKFk6Vj4RC94ZtMErmj1cTnTW2DcRCtwbhEJ9vbRc0lwQt 2Gsx2KY7AGw6a4P/dgKmR3rwcNFgS20rgV+KhklrIS1JaSbjc58lHSEJweVUx++i+t3u 2STGbA6HCt8oOt5++KUxvlE7X/AQLqXLNV0DNCmpZ7NRK8216YjT4j6DuskHDTV99AY3 rIzg== 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; bh=UQ+OLbLo1LBhf/EwzMQ8PnzT3asyCsRhwVHLAOdJs2Q=; b=NAMDaSdMhYiSy5qIykAf/3Bwu66d0pmtsa0WcSjLYWWMk3tHA3jmncWbl047cK/jzB hcFicYxn7TXz+S8XhWC88+geuT1S8NEaP5v/nC90GPbpiBdfJNECboXeItu5KfIVO6cz qMYP5utYSgxq/YkeCouAZRrRGAZ1eHRRRq6pvzQTxOe+606xkA1Roe3BV8LR678rlO/A 8/r9guyvplMlqPBKFWN3awxn2lcl0UyDkX3VJ77vvX10YgG9KUo79O1hNTeB//kSw+uC vvfYvKq7KB2aVSxCejlOASkQ3XgASVnNuc/Lin1NMi0XoYR207UBj2d9gqdlXzDokJg4 Ygxg== 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 s17si2107449pfc.273.2019.05.10.07.52.46; Fri, 10 May 2019 07:53:03 -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 S1727459AbfEJOtU (ORCPT + 99 others); Fri, 10 May 2019 10:49:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:59104 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727144AbfEJOtU (ORCPT ); Fri, 10 May 2019 10:49:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 85445AFD2; Fri, 10 May 2019 14:49:18 +0000 (UTC) Date: Fri, 10 May 2019 16:49:17 +0200 From: Petr Mladek To: Linus Torvalds Cc: 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: <20190510144917.lrgftg4wjfcyxoku@pathway.suse.cz> References: <20190510081635.GA4533@jagdpanzerIV> <20190510084213.22149-1-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190510084213.22149-1-pmladek@suse.com> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2019-05-10 10:42:13, Petr Mladek wrote: > The commit 3e5903eb9cff70730 ("vsprintf: Prevent crash when dereferencing > invalid pointers") broke boot on several architectures. The common > pattern is that probe_kernel_read() is not working during early > boot because userspace access framework is not ready. > > It is a generic problem. We have to avoid any complex external > functions in vsprintf() code, especially in the common path. > They might break printk() easily and are hard to debug. > > Replace probe_kernel_read() with some simple checks for obvious > problems. JFYI, I have sent a pull request with this patch, see https://lkml.kernel.org/r/20190510144718.riyy72g4cy5nkggx@pathway.suse.cz Best Regards, Petr