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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4AC51244.1010600@linux.vnet.ibm.com>
Date:	Thu, 01 Oct 2009 17:34:12 -0300
From:	Breno Leitao <leitao@...ux.vnet.ibm.com>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
CC:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] jsm: fixing termios structure to be compatible with stty
 application

Alan Cox wrote:
> NAK
> 
> termios->c_ispeed/ospeed are the actual baud rates not bit encodings
Well, c_flag & CBAUD is the baud rate encoded in the Bfoo format. 

> Use
> 
> 	tty_termios_encode_baudrate(termios, ispeed, ospeed);

Well, let me explain you what I want to do. 
Actually stty.c source code do: 

	tcsetattr (STDIN_FILENO, TCSADRAIN, &mode)
	tcgetattr (STDIN_FILENO, &new_mode)
	...
	if (memcmp (&mode, &new_mode, sizeof (mode)) != 0)
		 error (EXIT_FAILURE, 0,....)

When I run stty -F /dev/ttyn0 speed 9600, the mode structure is different
from new_mode, causing that error.
Debugging those structure, I found that ispeed and ospeed were not set in the
Bfoo format, as expected, since mode->[o|i]speed are set in Bfoo format.

Hence, I just assigned ospeed and ispeed with the requested speed in Bfoo
format (c_flag & CBAUD).

I also tested the tty_termios_encode_baud_rate(), and it will basically do what
I did:

        termios->c_ispeed = ibaud;
        termios->c_ospeed = obaud;

Thanks for the review, and sorry if I missed the point completely.
Breno
--
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