Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1068148rwi; Mon, 10 Oct 2022 10:42:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4pymvQLbkvlZGbrCkyW/Wg09H6ffag4/7daWsMGDlkQ5bwrRt+ox1pjVQsTg9QTu4ojWCh X-Received: by 2002:a05:6402:3806:b0:450:bad8:8cd5 with SMTP id es6-20020a056402380600b00450bad88cd5mr19275333edb.305.1665423760314; Mon, 10 Oct 2022 10:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665423760; cv=none; d=google.com; s=arc-20160816; b=W42ymklLatFfwFecJk6XwpAiDyWZKkXTKqLy/9Bdb//UN1xNJLGS7SmwBbc0yN1PHS e1YtGl96LaG6opCdpUHyuiA5lCG56gPM+HVBx3Q7u1AXPcOsVx1+bZkpmMowfrTNcUeN n2S6dNt5XRNvdfyc0qQhfFcrG3mNwj7x/FwwhgJWHvT9FHnP7JQWO0NjEVdYpPgP6GPN 0gVtYA6XvkgQkvrs4MqyQhbDyf6d/MZYO1cSBxC6ojOx7zN7RD1XnzlIwcIp81YfDhnT ixPVt2ldQWTct0pKyjEwg0//lEHO4pyZ/vMfl+0physsjnFXFY99N0x3eSnTGWICGk52 axpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=spVmW88ToSYozonwZUU/UYugXJxkW1/x4uVkEF9dSN8=; b=wnCoh9fDJTv0oDisHyGDhtKXVg85CbQZAA6s7Oxo60yAv3cyDlOS6upkSWGZkzzbH6 9sUAqLdougOo/pwDKP9aPJy75ERRthNrpXp0tQrHLZ8YlLk7lFAaTf7L+dNbzUR6j207 upaQNykp9Gl92rzM+7RXGz1YXIERzOqv7baHUoWr3wJ1rknAZNMIPkT3U2rOFtd/MK2r vB2GB2M01Uj382v/bkq13aS+uO0cNKvcCooc8SHiUMfcf9+pFicSeJa7e9EDF/Isiim5 /B2WDiaVnkG4Pcu4NdbLySIkO2SgGg5p2PdA4u9r3bppZF9qIF0r2cO4b576k2AVjjlb rZvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xCZZuKEz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs13-20020a1709073e8d00b0078d27a75198si13347953ejc.522.2022.10.10.10.42.12; Mon, 10 Oct 2022 10:42:40 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xCZZuKEz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229841AbiJJRCJ (ORCPT + 99 others); Mon, 10 Oct 2022 13:02:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbiJJRCF (ORCPT ); Mon, 10 Oct 2022 13:02:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 508C72CDFA for ; Mon, 10 Oct 2022 10:02:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EA94260F7B for ; Mon, 10 Oct 2022 17:02:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AAD8C433C1; Mon, 10 Oct 2022 17:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665421322; bh=olIi+YMItqG/0/E5CfQ3WkfdBfThnHS42hOtO0yZ/Ao=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xCZZuKEzkzhFcWMDP1QPOjn2O7iCMq/qYcH9cXbgExs1IlxyHle0RMBOIk6FAfa+M lMM95GYfmiG9sv6VxWJPm1ntJ4hGlfGLCbyngIiehPQuLWXClRpRwbLGmX0DlmFwGp 0EvWwrwrhp+BFwUww2+1qNkLStX4ntlZ5yWnb8Ww= Date: Mon, 10 Oct 2022 19:02:46 +0200 From: Greg KH To: Mushahid Hussain Cc: samuel.thibault@ens-lyon.org, speakup@linux-speakup.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Speakup: fix a segfault caused by switching consoles Message-ID: 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: <20221010165720.397042-1-mushi.shar@gmail.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 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? Should it go to stable kernels? thanks, greg k-h