From owner-p4-projects@FreeBSD.ORG Sun Feb 25 10:24:48 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B8A7816A403; Sun, 25 Feb 2007 10:24:48 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7268416A401 for ; Sun, 25 Feb 2007 10:24:48 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD4313C4A5 for ; Sun, 25 Feb 2007 10:24:48 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l1PAOm2w020283 for ; Sun, 25 Feb 2007 10:24:48 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l1PAOlUp020280 for perforce@freebsd.org; Sun, 25 Feb 2007 10:24:47 GMT (envelope-from rdivacky@FreeBSD.org) Date: Sun, 25 Feb 2007 10:24:47 GMT Message-Id: <200702251024.l1PAOlUp020280@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 115016 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2007 10:24:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=115016 Change 115016 by rdivacky@rdivacky_witten on 2007/02/25 10:24:38 Return EINVAL for invalid flags combination or non-page aligned addr in mremap(). This fixes mremap02 LTP test. Affected files ... .. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#61 edit .. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.h#5 edit Differences ... ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#61 (text+ko) ==== @@ -591,6 +591,18 @@ (unsigned long)args->new_len, (unsigned long)args->flags); #endif + + if (args->flags & ~(LINUX_MREMAP_FIXED | LINUX_MREMAP_MAYMOVE)) { + td->td_retval[0] = 0; + return (EINVAL); + } + + /* Linux defines PAGE_MASK to be FreeBSD ~PAGE_MASK */ + if (args->addr & PAGE_MASK) { + td->td_retval[0] = 0; + return (EINVAL); + } + args->new_len = round_page(args->new_len); args->old_len = round_page(args->old_len); ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.h#5 (text+ko) ==== @@ -42,4 +42,7 @@ #define LINUX_MAX_COMM_LEN 16 /* Maximum length of the process name. */ +#define LINUX_MREMAP_MAYMOVE 1 +#define LINUX_MREMAP_FIXED 2 + #endif /* _LINUX_MISC_H_ */