From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E721BC4332F for ; Thu, 2 Nov 2023 05:47:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230390AbjKBFrv (ORCPT ); Thu, 2 Nov 2023 01:47:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235794AbjKBFph (ORCPT ); Thu, 2 Nov 2023 01:45:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EB0F112; Wed, 1 Nov 2023 22:45:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68F08C433C8; Thu, 2 Nov 2023 05:45:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698903931; bh=deTWce1Ruc+WuMtuvtN9mov19AKFx2bIim+XWnVSxyY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XFIZyzIM6Os/iGOUa/HBwCScp/KWQ75JB5Pxl+4A3LNJqZGM6tDk/gDrY5zF1BevE /7K8pQZg58ICXeHGyRPhoYoJrU1zR/pgPlfaQNe+0N2IemO4XII/p6b14c/wLvz7m2 OECxYE+IreLfyBoX8+RRBIUtqwrOzIBsTSSSLyNs= Date: Thu, 2 Nov 2023 06:45:28 +0100 From: Greg KH To: dimadrumspro@gmail.com Cc: dimaac@bk.ru, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH 2/2] drivers: tty: vt: vt.c: fixed segmentation fault in vt.c Message-ID: <2023110236-onstage-skipper-30be@gregkh> References: <20231101235332.4314-1-dimadrumspro@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231101235332.4314-1-dimadrumspro@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org On Thu, Nov 02, 2023 at 12:53:32AM +0100, dimadrumspro@gmail.com wrote: > From: dimaaac > > The previous code lacked proper synchronization, leading to potential data corruption and crashes. Added a spin lock to protect shared variable 'scrollback_delta' to prevent concurrent access. > > Signed-off-by: dimaaac > --- > drivers/tty/vt/vt.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c > index 5c47f77804f0..29cf7fe11662 100644 > --- a/drivers/tty/vt/vt.c > +++ b/drivers/tty/vt/vt.c > @@ -301,12 +301,13 @@ static inline unsigned short *screenpos(const struct vc_data *vc, int offset, > } > > /* Called from the keyboard irq path.. */ > +static DEFINE_SPINLOCK(scrolldelta_lock); > + > static inline void scrolldelta(int lines) > { > - /* FIXME */ > - /* scrolldelta needs some kind of consistency lock, but the BKL was > - and still is not protecting versus the scheduled back end */ > + spin_lock(&scrolldelta_lock); > scrollback_delta += lines; > + spin_unlock(&scrolldelta_lock); > schedule_console_callback(); > } > > -- > 2.42.0 > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what is needed in order to properly describe the change. - You did not write a descriptive Subject: for the patch, allowing Greg, and everyone else, to know what this patch is all about. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what a proper Subject: line should look like. - It looks like you did not use your "real" name for the patch on either the Signed-off-by: line, or the From: line (both of which have to match). Please read the kernel file, Documentation/process/submitting-patches.rst for how to do this correctly. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot