#
5738d741 |
| 24-Jan-2024 |
Kyle Evans <kevans@FreeBSD.org> |
kern: tty: fix recanonicalization
`ti->ti_begin` is actually the offset within the first block that is unread, so we must use that for our lower bound.
Moving to the previous block has to be done a
kern: tty: fix recanonicalization
`ti->ti_begin` is actually the offset within the first block that is unread, so we must use that for our lower bound.
Moving to the previous block has to be done at the end of the loop in order to correctly handle the case of ti_begin == TTYINQ_DATASIZE. At that point, lastblock is still the last one with data written and the next write into the queue would advance lastblock. If we move to the previous block at the beginning, then we're essentially off by one block for the entire scan and run the risk of running off the end of the block queue.
The ti_begin == 0 case is still handled correctly, as we skip the loop entirely and the linestart gets recorded as the first byte available for writing. The bit after the loop about moving to the next block is also still correct, even with both previous fixes in mind: we skipped moving to the previous block if we hit ti_begin, and `off + 1` would in-fact be a member of the next block from where we're reading if it falls on a block boundary.
Reported by: dim Fixes: 522083ffbd1ab ("kern: tty: recanonicalize the buffer on [...]")
show more ...
|
#
522083ff |
| 16-Jan-2024 |
Kyle Evans <kevans@FreeBSD.org> |
kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes
Before this change, we would canonicalize any partial input if the new local mode is not ICANON, but that's about it. If we were swi
kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes
Before this change, we would canonicalize any partial input if the new local mode is not ICANON, but that's about it. If we were switching from -ICANON -> ICANON, or if VEOF/VEOL changes, then our internal canon accounting would be wrong.
The main consequence of this is that in ICANON mode, we would potentially hang a read(2) longer if the new VEOF/VEOL appears later in the buffer, and FIONREAD would be similarly wrong as a result.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D43456
show more ...
|
#
09a43b87 |
| 16-Jan-2024 |
Kyle Evans <kevans@FreeBSD.org> |
kern: tty: fix ttyinq_read_uio assertion
It's clear from later context that `rlen` was always expected to include `flen`, as we'll trim `flen` bytes from the end of the read. Relax our initial asse
kern: tty: fix ttyinq_read_uio assertion
It's clear from later context that `rlen` was always expected to include `flen`, as we'll trim `flen` bytes from the end of the read. Relax our initial assertion to only require the total size less trimmed bytes to lie within the out buffer size.
While we're here, I note that if we have to read more than one block and we're trimming from the end then we'll do the wrong thing and omit `flen` bytes from every block, rather than just the end. Add an assertion to make sure we're not doing that, but the only caller that specifies a non-zero `flen` today will only really be doing so if rlen is entirely within a single buffer.
Reviewed by: cy, imp Differential Revision: https://reviews.freebsd.org/D43377
show more ...
|
#
fdafd315 |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remov
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0 |
|
#
d7696096 |
| 12-Apr-2022 |
Mark Johnston <markj@FreeBSD.org> |
tty: Remove an incorrect assertion from ttyinq_line_iterate()
We may legitimately have tib == NULL if we're at the very end of the queue.
PR: 215373 Reported by: pho MFC after: 1 week Sponsored by
tty: Remove an incorrect assertion from ttyinq_line_iterate()
We may legitimately have tib == NULL if we're at the very end of the queue.
PR: 215373 Reported by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
show more ...
|
Revision tags: release/12.3.0, release/13.0.0, release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0, release/12.0.0, release/11.2.0 |
|
#
a2bb4e08 |
| 19-May-2018 |
Matt Macy <mmacy@FreeBSD.org> |
tty: use __unused annotation instead to silence warnings
|
#
3ef78c9c |
| 19-May-2018 |
Matt Macy <mmacy@FreeBSD.org> |
tty: conditionally assign to ret value only used by MPASS statement
|
#
8a36da99 |
| 27-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
sys/kern: adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone
sys/kern: adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
show more ...
|
Revision tags: release/10.4.0, release/11.1.0 |
|
#
d370fd1c |
| 14-Jan-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r311940 through r312200.
|
#
a6f63533 |
| 13-Jan-2017 |
Ian Lepore <ian@FreeBSD.org> |
Check tty_gone() after allocating IO buffers. The tty lock has to be dropped then reacquired due to using M_WAITOK, which opens a window in which the tty device can disappear. Check for this and re
Check tty_gone() after allocating IO buffers. The tty lock has to be dropped then reacquired due to using M_WAITOK, which opens a window in which the tty device can disappear. Check for this and return ENXIO back up the call chain so that callers can cope.
This closes a race where TF_GONE would get set while buffers were being allocated as part of ttydev_open(), causing a subsequent call to ttydevsw_modem() later in ttydev_open() to assert.
Reported by: pho Reviewed by: kib
show more ...
|
Revision tags: release/11.0.1, release/11.0.0, release/10.3.0, release/10.2.0, release/10.1.0, release/9.3.0, release/10.0.0, release/9.2.0, release/8.4.0, release/9.1.0, release/8.3.0_cvs, release/8.3.0 |
|
#
8fa0b743 |
| 23-Jan-2012 |
Xin LI <delphij@FreeBSD.org> |
IFC @230489 (pending review).
|
#
80dbff4e |
| 04-Jan-2012 |
Sean Bruno <sbruno@FreeBSD.org> |
IFC to head to catch up the bhyve branch
Approved by: grehan@
|
Revision tags: release/9.0.0 |
|
#
dc15eac0 |
| 02-Jan-2012 |
Ed Schouten <ed@FreeBSD.org> |
Use strchr() and strrchr().
It seems strchr() and strrchr() are used more often than index() and rindex(). Therefore, simply migrate all kernel code to use it.
For the XFS code, remove an empty lin
Use strchr() and strrchr().
It seems strchr() and strrchr() are used more often than index() and rindex(). Therefore, simply migrate all kernel code to use it.
For the XFS code, remove an empty line to make the code identical to the code in the Linux kernel.
show more ...
|
#
935205e2 |
| 17-Jul-2011 |
Justin T. Gibbs <gibbs@FreeBSD.org> |
Integrate from Head into ZFSD feature branch as of revision r224141.
|
#
23300944 |
| 30-Jun-2011 |
Peter Grehan <grehan@FreeBSD.org> |
IFC @ r223696 to pick up dfr's userboot
|
#
40a03457 |
| 28-Jun-2011 |
Attilio Rao <attilio@FreeBSD.org> |
MFC
|
#
7c966927 |
| 26-Jun-2011 |
Ed Schouten <ed@FreeBSD.org> |
Fix whitespace inconsistencies in the TTY layer and its drivers owned by me.
|
Revision tags: release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0, release/8.1.0_cvs, release/8.1.0, release/7.3.0_cvs, release/7.3.0 |
|
#
1a0fda2b |
| 04-Mar-2010 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
IFH@204581
|
#
f0045289 |
| 07-Feb-2010 |
Ed Schouten <ed@FreeBSD.org> |
Remove statistics from the TTY queues.
I added counters to see how often fast copying to userspace was actually performed, which was only useful during development. Remove these statistics now we kn
Remove statistics from the TTY queues.
I added counters to see how often fast copying to userspace was actually performed, which was only useful during development. Remove these statistics now we know it to be effective.
show more ...
|
#
081a0db3 |
| 18-Jan-2010 |
Ed Schouten <ed@FreeBSD.org> |
Remove a dead initialization.
Spotted by: scan-build (uqs)
|
Revision tags: release/8.0.0_cvs, release/8.0.0 |
|
#
10b3b545 |
| 17-Sep-2009 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
Merge from head
|
#
7d4b968b |
| 17-Sep-2009 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
Merge from head up to r188941 (last revision before the USB stack switch)
|
#
2e370a5c |
| 26-May-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
Merge from HEAD
|