Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1093572rwi; Mon, 10 Oct 2022 11:05:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Kz3fN5Q9Voa4e01z+lxPKBw2E7W1jHTUZevIIM4t8YB7oto1Q6VviM0EpMTvfAGRrbDvd X-Received: by 2002:a05:6402:3705:b0:454:e006:82 with SMTP id ek5-20020a056402370500b00454e0060082mr18902023edb.360.1665425100983; Mon, 10 Oct 2022 11:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665425100; cv=none; d=google.com; s=arc-20160816; b=uH4/+D5ioS/wVPk2TE9f32zu31b9FGhWMsXcVV4e3BTZCs04oRo5IH0YYjqjXwM6Ob 88wTWrVaO5Bhful+opTCqJdJ8qyTuab3JAONJ2sboeSyBYMUjzxap0Ki13OKzaY7S6yC T5j2DKF6TOrid4o9zYkTTX8saondj2Oz/OeuF4dBMnwtb/yVLbufODoUK1KuK5+gBvOF sP3Ct3PaOsMZI6rnd2AcgiPkiqDd+6mrjUW4aRBZz6jMIDlKhdydCNj3nCpp103KMkYe 4Ha4l52qOR9f8IHV0hCJB5yRKHcSnDdWkkuHGmyW2wjeQCSHGiXh0W80eyhtLyqL/zPd INNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:organization:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=iRoWBt6xDtz2m5kttQkNIj1ryV6yauLRRFU+mBUazkQ=; b=fNyYILha/JpYZ5DmnHV1xGCc0C5hDkja2FwBCtshn2+Ss6d50H9A99PEP8ZJUDe2ry y9FwOTuvzsPghV4gfh6IYfA7tLFKi1cyXAoNrXFcaevwQWe1LXbGuESuy9CvND2xtktL w8GZzCMA9b9v93tkRxqKmGhMnMVlj2aihURKSz3e2SvIxahtq8te2/ocgqVMMSPcvgoX 5HuWlbn2/F0CG5xDCh/Wa3MuE03XY6x7cSIL0rn5qgtvwIXw1LB62gUoc1YPMPqs3OyV qCEZminne2OZi+3p6D/YziURI4fUnRrhlbqj5YVgVB+LeN1SpMiqi5wqP1xTpm3IPAh5 bI0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f8-20020a056402068800b004478e283f05si8672899edy.104.2022.10.10.11.04.35; Mon, 10 Oct 2022 11:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbiJJRRP (ORCPT + 99 others); Mon, 10 Oct 2022 13:17:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbiJJRRM (ORCPT ); Mon, 10 Oct 2022 13:17:12 -0400 Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF2BB74DFF for ; Mon, 10 Oct 2022 10:17:09 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id C90BB2015F; Mon, 10 Oct 2022 19:17:07 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JDNmcF0NPE6w; Mon, 10 Oct 2022 19:17:07 +0200 (CEST) Received: from begin.home (lfbn-bor-1-376-208.w109-215.abo.wanadoo.fr [109.215.91.208]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 61F9A2011C; Mon, 10 Oct 2022 19:17:07 +0200 (CEST) Received: from samy by begin.home with local (Exim 4.96) (envelope-from ) id 1ohwOo-006OrU-36; Mon, 10 Oct 2022 19:17:06 +0200 Date: Mon, 10 Oct 2022 19:17:06 +0200 From: Samuel Thibault To: Greg KH Cc: Mushahid Hussain , speakup@linux-speakup.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Speakup: fix a segfault caused by switching consoles Message-ID: <20221010171706.7omuxueiuyqugjha@begin> Mail-Followup-To: Samuel Thibault , Greg KH , Mushahid Hussain , speakup@linux-speakup.org, linux-kernel@vger.kernel.org References: <20221010165720.397042-1-mushi.shar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Greg KH, le lun. 10 oct. 2022 19:02:46 +0200, a ecrit: > On Mon, Oct 10, 2022 at 09:57:20PM +0500, Mushahid Hussain wrote: > > This patch fixes a segfault by adding a null check on synth in > > speakup_con_update(). The segfault can be reproduced as follows: > > > > - Login into a text console > > > > - Load speakup and speakup_soft modules > > > > - Remove speakup_soft > > > > - Switch to a graphics console > > > > This is caused by lack of a null check on `synth` in > > speakup_con_update(). > > > > Here's the sequence that causes the segfault: > > > > - When we remove the speakup_soft, synth_release() sets the synth > > to null. > > > > - After that, when we change the virtual console to graphics > > console, vt_notifier_call() is fired, which then calls > > speakup_con_update(). > > > > - Inside speakup_con_update() there's no null check on synth, > > so it calls synth_printf(). > > > > - Inside synth_printf(), synth_buffer_add() and synth_start(), > > both access synth, when it is null and causing a segfault. > > > > Therefore adding a null check on synth solves the issue. > > > > Signed-off-by: Mushahid Hussain > > Signed-off-by: Samuel Thibault > > --- > > drivers/accessibility/speakup/main.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > What commit id does this fix? It is there since 2610df41489f548e235171b86895d4b49e6acb1f ("staging: speakup: Add pause command used on switching to graphical mode") > Should it go to stable kernels? Yes, please. Mushahid, you can see in Documentation/process/submitting-patches.rst how to encode this in the patch submission. Samuel