Skip to content

Conversation

@michich
Copy link

@michich michich commented Jun 7, 2025

The Linux implementation of TCGETS in rshim_fuse_console_ioctl() uses sizeof(struct termio), but the type of bd->cons_termios is 'struct termios', not 'struct termio'.
Also, "man TCGETS" confirms the expected type is 'struct termios':
int ioctl(int fd, TCGETS, struct termios *argp);

I noticed this bug only because glibc recently removed[1] the definition of struct termio. rshim then failed to build on Fedora Rawhide.

[1] "linux/termio: remove <termio.h> and struct termio"
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=e04afb71771710cdc6025fe95908f5f17de7b72d

The Linux implementation of TCGETS in rshim_fuse_console_ioctl() uses
sizeof(struct termio), but the type of bd->cons_termios is
'struct termios', not 'struct termio'.
Also, "man TCGETS" confirms the expected type is 'struct termios':
  int ioctl(int fd, TCGETS, struct termios *argp);

I noticed this bug only because glibc recently removed[1] the definition
of struct termio. rshim then failed to build on Fedora Rawhide.

[1] "linux/termio: remove <termio.h> and struct termio"
    https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=e04afb71771710cdc6025fe95908f5f17de7b72d

Signed-off-by: Michal Schmidt <[email protected]>
Copy link
Collaborator

@lsun100 lsun100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow this change caused the 'screen' app to crash when connecting to the device. We'll try to investigate it as well what else might be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants