[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1050290: glibc: Harmless bug in tcsetattr() handling of CREAD, CSIZE, PARENB bits



Source: glibc
Severity: minor

Dear Maintainer,

I believe that the "any/local-tcsetaddr.diff" (sic) patch applied to the glibc
sources contains a probably unmanifestible bug in the checking of c_cflag
changes other than the PARENB, CREAD, and CSIZE bits here:

+      else if ((k_termios_old.c_cflag | (PARENB & CREAD & CSIZE)) !=
+              (k_termios.c_cflag | (PARENB & CREAD & CSIZE)))
+       {
+         /* Some other c_cflag setting was successfully changed, which
+            means we should not return an error. */
+         __set_errno (save);
+         retval = 0;
+       }

I believe the (PARENB & CREAD & CSIZE) subexpressions (which evaluate to 0)
should be (PARENB | CREAD | CSIZE).

This bug should be harmless as long as the TTY device either handles changes to
the PARENB, CREAD, and CSIZE settings, or always sets them to consistently
fixed values.


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (920, 'testing'), (910, 'unstable'), (820, 'testing'), (810, 'unstable'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable-debug'), (500, 'unstable'), (500, 'stable'), (120, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf

Kernel: Linux 6.4.0-2-amd64 (SMP w/6 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled


Reply to: