From: Jiri Slaby <jirislaby@kernel.org>
To: Dianne Skoll <dianne@skoll.ca>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: N_HDLC line discipline: Race condition
Date: Tue, 21 May 2024 12:47:00 +0200 [thread overview]
Message-ID: <63a5a3c5-8362-4b93-a50e-10c9cdcffdd2@kernel.org> (raw)
In-Reply-To: <20240425140127.6504ade1@gato.skoll.ca>
On 25. 04. 24, 20:01, Dianne Skoll wrote:
> Hi,
>
> I have (somewhat) narrowed down when the kernel bug appeared by installing
> Debian 10, 11 and 12 in KVM virtual machines.
>
> The bug is NOT present in Debian 10, kernel version 4.19.67.
>
> The bug IS present in Debian 11, kernel version 5.10.209
>
> The bug IS present in Debian 12, kernel version 6.1.85
>
> So I guess it was introduced sometime between 4.19.67 and 5.10.209. I'll
> take a look to see if I can do a git bisect.
>
> [To recap, the bug is that the N_HDLC line discipline sometimes
> coalesces two write()s so you get them both back in a single read()
> which is contrary to what it's supposed to do... preserve the write
> boundaries as individual frames.]
I believe it is a correct behavior after all. As you use pty for
testing, the "framing" is lost during the pty-to-pty pass on the flush
to ldisc path (receive_buf()).
[ T1056] n_hdlc_send_frames: ptm2 sending frame 0000000081e69927, count=6
[ T1056] frame 0000000081e69927 completed
[ T1056] n_hdlc_send_frames: ptm2 sending frame 00000000576db119, count=5
[ T1056] frame 00000000576db119 completed
[ T123] n_hdlc_tty_receive: pts2 buf=00000000a616a2be count=11
[ T1056] n_hdlc_tty_read: pts2 rbuf=00000000a616a2be
kbuf=000000004abc3c35 offset=0 ret=11
thanks,
--
js
suse labs
next prev parent reply other threads:[~2024-05-21 10:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 21:31 N_HDLC line discipline: Race condition Dianne Skoll
2024-04-25 18:01 ` Dianne Skoll
2024-05-15 10:33 ` Jiri Slaby
2024-05-15 13:42 ` Dianne Skoll
2024-05-15 15:44 ` Dianne Skoll
2024-05-21 10:47 ` Jiri Slaby [this message]
2024-05-21 14:15 ` Dianne Skoll
2024-05-23 8:01 ` Jiri Slaby
2024-05-23 12:44 ` Dianne Skoll
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=63a5a3c5-8362-4b93-a50e-10c9cdcffdd2@kernel.org \
--to=jirislaby@kernel.org \
--cc=dianne@skoll.ca \
--cc=gregkh@linuxfoundation.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.