Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752053AbbEGXYU (ORCPT ); Thu, 7 May 2015 19:24:20 -0400 Received: from mail-qc0-f175.google.com ([209.85.216.175]:34169 "EHLO mail-qc0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751377AbbEGXYR (ORCPT ); Thu, 7 May 2015 19:24:17 -0400 Message-ID: <554BF418.5080200@hurleysoftware.com> Date: Thu, 07 May 2015 19:24:08 -0400 From: Peter Hurley User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Andrew Morton , Josh Triplett CC: Linus Torvalds , Fengguang Wu , Iulia Manda , "Paul E. McKenney" , Fabian Frederick , Linux Memory Management List , linux-kernel@vger.kernel.org Subject: Re: [PATCH] devpts: If initialization failed, don't crash when opening /dev/ptmx References: <20150507003547.GA6862@jtriplet-mobl1> <20150507155919.16ab7177e4956d8f47803750@linux-foundation.org> In-Reply-To: <20150507155919.16ab7177e4956d8f47803750@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1226 Lines: 28 On 05/07/2015 06:59 PM, Andrew Morton wrote: > On Wed, 6 May 2015 17:35:47 -0700 Josh Triplett wrote: > >> If devpts failed to initialize, it would store an ERR_PTR in the global >> devpts_mnt. A subsequent open of /dev/ptmx would call devpts_new_index, >> which would dereference devpts_mnt and crash. >> >> Avoid storing invalid values in devpts_mnt; leave it NULL instead. >> Make both devpts_new_index and devpts_pty_new fail gracefully with >> ENODEV in that case, which then becomes the return value to the >> userspace open call on /dev/ptmx. > > It looks like the system is pretty crippled if init_devptr_fs() fails. > Can the user actually get access to consoles and do useful things in > this situation? Maybe it would be better to just give up and panic? A single-user console is definitely reachable without devpts. >From there, one could fixup to a not-broken kernel. Regards, Peter Hurley PS - But I saw you already added these to -mm -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/