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]
Date:	Sat, 29 Dec 2007 02:29:30 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Jiri Slaby <jirislaby@...il.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	<linux-kernel@...r.kernel.org>, Adrian Bunk <bunk@...nel.org>,
	Michael Tokarev <mjt@....msk.ru>,
	Jiri Slaby <jirislaby@...il.com>
Subject: Re: [PATCH 1/1] mxser, remove it

> +	if (cmd == MOXA_SET_SPECIAL_BAUD_RATE) {
> +		int speed;
> +
> +		if (get_user(speed, (int __user *)argp))
> +			return -EFAULT;
> +		if (speed <= 0 || speed > info->max_baud)
> +			return -EFAULT;

-EINVAL

> +		if (!info->tty || !info->tty->termios || !info->ioaddr)
> +			return 0;

!info->tty and !info->tty->termios can't happen

> +		info->tty->termios->c_cflag &= ~(CBAUD | CBAUDEX);

No...

> +		for (i = 0; i < BAUD_TABLE_NO; i++)
> +			if (speed == mxvar_baud_table[i])
> +				break;
> +		if (i == BAUD_TABLE_NO) {
> +			info->tty->termios->c_cflag |= B_SPEC;
> +		} else if (speed != 0)
> +			info->tty->termios->c_cflag |= mxvar_baud_table1[i];

Replace all the above mess with a single tty_encode_baud_rate call

--
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