From: Greg KH <greg@kroah.com>
To: dimadrumspro@gmail.com
Cc: 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
Date: Thu, 2 Nov 2023 12:42:48 +0100 [thread overview]
Message-ID: <2023110206-robin-feel-d73f@gregkh> (raw)
In-Reply-To: <20231102113926.2019-1-dimadrumspro@gmail.com>
Where is patch 1/2?
On Thu, Nov 02, 2023 at 12:39:26PM +0100, dimadrumspro@gmail.com wrote:
> From: Dima <dimadrumspro@gmail.com>
Is that your full name?
>
> 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.
Please wrap your lines properly, as your editor hinted that you should.
And always run scripts/checkpatch.pl on your patch before submitting it.
>
> Signed-off-by: Dima <dimadrumspro@gmail.com>
> ---
> 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);
How exactly did you test this? This patch does not do anything that I
can determine.
And what "crashes" have you fixed here? What "data corruption"? Your
changelog text does not match this actual change at all from what I can
tell.
thanks,
greg k-h
next prev parent reply other threads:[~2023-11-02 11:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-02 11:39 [PATCH 2/2] drivers: tty: vt: vt.c: fixed segmentation fault in vt.c dimadrumspro
2023-11-02 11:42 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-11-01 23:53 dimadrumspro
2023-11-02 5:45 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2023110206-robin-feel-d73f@gregkh \
--to=greg@kroah.com \
--cc=dimadrumspro@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).