lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACMCwJJzOG=diSwDW3yg6zsfwQjTVRjV+9f3S5UHp6Or-meZWQ@mail.gmail.com>
Date:	Thu, 5 Feb 2015 12:56:20 +0200
From:	Jari Ruusu <jariruusu@...rs.sourceforge.net>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: usb serial: pl2303 driver TxD "break" stays after close() bug

Tested on 3.10.67 and 3.18.5 kernels with ATEN UC-232A usb-serial adapter.
No patch, sorry. To actually see the stuck "break" signal on TxD line, you
need either some sort of LED or voltmeter connected to the data transmit
line. Other RS-232 serial ports that I have access to (normal PC hardware
serial ports and FTDI usb-serial adapters) do not have this bug.


/* pl2303 TxD "break" stays after close() demo */

#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <termios.h>
#include <fcntl.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
    struct termios tt;
    int fd;

    if(argc < 2) {
        fprintf(stderr, "usage: %s /dev/ttyUSB0\n", argv[0]);
        exit(1);
    }
    if((fd = open(argv[1], O_RDWR | O_NOCTTY, 0)) == -1) {
        perror("serial port open failed");
        exit(1);
    }
    tcgetattr(fd, &tt);
    cfmakeraw(&tt);
    tcsetattr(fd, TCSANOW, &tt);
    if(ioctl(fd, TIOCSBRK, 0) == -1) {
        perror("set BRK failed");
        exit(1);
    }
    close(fd);
    exit(0);
}

-- 
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ