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:	Tue, 12 May 2009 13:33:44 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Ingo Molnar <mingo@...e.hu>, x86@...nel.org,
	linux-kernel@...r.kernel.org,
	Remis Lima Baima <remis.developer@...glemail.com>
Subject: [PATCH v3] x86: fix ktermios-termio conversion

The legacy TCSETA{,W,F} ioctls failed to set the termio->c_line field
on x86. This adds a missing get_user.

The same ioctls also fail to report faulting user pointers, which
we keep ignoring.

Signed-off-by: Arnd Bergmann <arnd@...db.de>
---

On Tuesday 12 May 2009, Alan Cox wrote:
> Arnd - can you send me a diff that keeps the existing horrible macro
> version, the existing __put_user usage and just fixes c_line ? It's
> worked for 15 years, its not worth the time being fancy with it.

I should probably have made my intention clearer. I'm sitting on a
series of patches [1] that generalize a lot of headers by making an
asm-generic version and falling back on this in all architectures that
have the same code.

The x86 SET_LOW_TERMIOS_BITS macro, besides its own stylistic problems,
only works on little-endian architectures and generates compiler warnings
on architectures on which get_user returns 'int __must_check'.
My asm-generic version fixes this by using the architecture independent
code I posted in this thread.

One of my later patches removes all x86 specific headers that are identical
to the asm-generic version. The termios.h header is almost identical,
so I first wanted to submit the patch to make it actually the same.

	Arnd <><

[1] git.kernel.org:/pub/scm/linux/kernel/git/arnd/asm-generic.git

diff --git a/arch/x86/include/asm/termios.h b/arch/x86/include/asm/termios.h
index f729563..c4ee805 100644
--- a/arch/x86/include/asm/termios.h
+++ b/arch/x86/include/asm/termios.h
@@ -67,6 +67,7 @@ static inline int user_termio_to_kernel_termios(struct ktermios *termios,
 	SET_LOW_TERMIOS_BITS(termios, termio, c_oflag);
 	SET_LOW_TERMIOS_BITS(termios, termio, c_cflag);
 	SET_LOW_TERMIOS_BITS(termios, termio, c_lflag);
+	get_user(termios->c_line, &termio->c_line);
 	return copy_from_user(termios->c_cc, termio->c_cc, NCC);
 }
 
--
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