Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966603AbbBDVxe (ORCPT ); Wed, 4 Feb 2015 16:53:34 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:45500 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966467AbbBDVxb (ORCPT ); Wed, 4 Feb 2015 16:53:31 -0500 From: Andy Lutomirski To: "Michael Kerrisk (man-pages)" , linux-kernel@vger.kernel.org Cc: Andy Lutomirski Subject: [PATCH manpages] modify_ldt.2: Clarify the lm bit's behavior Date: Wed, 4 Feb 2015 13:53:26 -0800 Message-Id: <27da5d1594c1b5b7db0e33d425edaa35d45535a8.1423086787.git.luto@amacapital.net> X-Mailer: git-send-email 2.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1526 Lines: 43 The lm bit should never have existed in the first place. Sigh. Signed-off-by: Andy Lutomirski --- man2/modify_ldt.2 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/man2/modify_ldt.2 b/man2/modify_ldt.2 index 1c2cf9cdef93..d6e0514973a6 100644 --- a/man2/modify_ldt.2 +++ b/man2/modify_ldt.2 @@ -187,12 +187,21 @@ The normal use for .BR modify_ldt (2) is to run legacy 16-bit or segmented 32-bit code. Not all kernels allow 16-bit segments to be installed, however. +.PP +Even on 64-bit kernels, +.BR modify_ldt (2) +cannot be used to create a long mode (i.e. 64-bit) code segment. The +undocumented field "lm" in +.IR user_desc +is not useful, and, despite its name, does not result in a long mode segment. .SH BUGS On 64-bit kernels before Linux 3.19, .\" commit e30ab185c490e9a9381385529e0fd32f0a399495 -setting the "lm" padding bit in +setting the "lm" bit in .IR user_desc -prevents the descriptor from being considered empty. +prevents the descriptor from being considered empty. Keep in mind that the +"lm" bit does not exist in the 32-bit headers, but these buggy kernels +will still notice the bit even when set in a 32-bit process. .SH SEE ALSO .BR arch_prctl (2), .BR set_thread_area (2), -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/