From patchwork Wed Sep 25 12:09:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shu Han X-Patchwork-Id: 13811969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E962C369D6 for ; Wed, 25 Sep 2024 12:09:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 99D7E6B009A; Wed, 25 Sep 2024 08:09:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94D746B009C; Wed, 25 Sep 2024 08:09:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7EE2C6B009D; Wed, 25 Sep 2024 08:09:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5E2EF6B009A for ; Wed, 25 Sep 2024 08:09:56 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 72DBB1201D5 for ; Wed, 25 Sep 2024 12:09:55 +0000 (UTC) X-FDA: 82603141950.19.92EDF40 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by imf22.hostedemail.com (Postfix) with ESMTP id 95F1FC0010 for ; Wed, 25 Sep 2024 12:09:53 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="mlJ/bC6n"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf22.hostedemail.com: domain of ebpqwerty472123@gmail.com designates 209.85.214.170 as permitted sender) smtp.mailfrom=ebpqwerty472123@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727266105; a=rsa-sha256; cv=none; b=wTl92ilPhsdsSghZnplVSfOcBWcPnjFHEBhXbdpgSmnhFs7Owl1UR7qE5zpsl101F1bGb0 3rWCFOqNtPZB11Kv2KpRjLr6acK6sy++ndiWT6qYuybBGKtNN2V/ykTglnybNL/bo28jNg mPbWubtpqog7U4WPGrftgH4gnSAgM0g= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="mlJ/bC6n"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf22.hostedemail.com: domain of ebpqwerty472123@gmail.com designates 209.85.214.170 as permitted sender) smtp.mailfrom=ebpqwerty472123@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727266105; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=l2FisBVLQp+Mpp2gLe0+K2SdxwaKyaEx+US7Xl2Qlvk=; b=Qb9O+xofpCYmVPnBsLwWAQblw/G7RbMgU/pEq2GY5tfYfBdq0D83sMdlQIUAnuGF7Bu/Ni kqMwJNqs4J3U/kSnMpEBPBXFtgn8yrRqR9tF60SjgRpWPYNTWXuhoAu4dGk2oKJq7gkvHy YA1lDtqT2mHoj+IOLSzlyERb31fOCwM= Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-20696938f86so53489975ad.3 for ; Wed, 25 Sep 2024 05:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727266192; x=1727870992; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=l2FisBVLQp+Mpp2gLe0+K2SdxwaKyaEx+US7Xl2Qlvk=; b=mlJ/bC6nygRPxo52bXA4tqcf4v0X5LhNYL2YskBDljRQBs6mZVz+ohFe8wQRLfIIqu N91beNxjKE9mPNn9BKTJroO38an3D03iMCCEPobrbGx4fJidQ89SE99ikFmnBTSzQ5/j ah6E8OG4efmvhmNlVEsuF1KXJS857DhZUFN6drjaESRo8G6JhoEaN6BNhIado9YmwjyW vtoPgLMxeyf05HLl49YwmoT8ZMQvcLuwdamNB5gkKWMZ0ILjASVjtK8mDhK+u5BDBS5g Bi52dgpq8yprO341crpv4+r8Q2WERGrad6tBXnOxe96BWZcBxWQJhuK3B8MKEl28wUP+ F0ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727266192; x=1727870992; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l2FisBVLQp+Mpp2gLe0+K2SdxwaKyaEx+US7Xl2Qlvk=; b=tFwDy+wEg+z1bONImNGbQqU3/Y3w/oCSqXJZx1RTtd6izap3hzQ+2uwhxveO8zEaPu lRtFpwcgTnbW3DJq6SD0luy+UfbRAF0VBM9/GscYEwI8LuMHwIK7nSpDfGpmD7L7rHez QAUkfUypxpHtYyQ8amVa55wGeDWpupesW3qizvhTUulwwLnR8tD6W6PYZtkxRwrnQLsb 5fbsUDo0QS/OUrq2ekmXBwYoj7CEeZ8eW/qBlUJ5M0cqQmzHnPvowcklmEVTG1u9LON5 e+qluoiMYmU+K0fs3QymMRAJvDmuWL4N3oe1/Dze+bhrGyxhEck5Mnl38bOf1I6eyRQe kRFg== X-Gm-Message-State: AOJu0YwKiWKGNGtXLIUrXy88SZAUmp5d2tCsfLNDbLr/cjo/opZu26J0 mzouRE+BQEMUjeVxBchxpTFkP0ZffhDwibbjxCsuQJ5LWu6rIIco X-Google-Smtp-Source: AGHT+IGWXYyYBWq7oMhjqosyqQ8QO24wRHge8W0P3gCGMEEoJNBxzafLWhP/hFeRitwp1xtW5F0klQ== X-Received: by 2002:a17:902:eccc:b0:207:6e8:1d84 with SMTP id d9443c01a7336-20afc4d809dmr33236615ad.42.1727266192161; Wed, 25 Sep 2024 05:09:52 -0700 (PDT) Received: from localhost.localdomain ([20.37.103.148]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af16e0340sm23547885ad.51.2024.09.25.05.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 05:09:51 -0700 (PDT) From: Shu Han To: akpm@linux-foundation.org, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, Liam.Howlett@oracle.com, vbabka@suse.cz, lorenzo.stoakes@oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [PATCH RFC v2] mm: move the check of READ_IMPLIES_EXEC out of do_mmap() Date: Wed, 25 Sep 2024 20:09:40 +0800 Message-Id: <20240925120940.309-1-ebpqwerty472123@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 95F1FC0010 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: fc1j95i6bfo9tm39heq59gdoc9khaqdj X-HE-Tag: 1727266193-99969 X-HE-Meta: U2FsdGVkX19n0NejBtkyMb6Mzelpp94oo1wgEDTec2GG/tGVRu0nTR2Uirz9tTsP9LbLJ6zCFpCXWav2dhhIaCXBT6gAX0q44qmPiDU2ZNX+4/hbOSRl147kKUBqMM07gdLRF3bpO4k6CQjFqfsBlXhFrkmMgE/4ILOuQeQSe5X4DJJxtvj8yDnjvo/qtVF1xXP1mSnIW1r3Rtg27BJQX8ZwxaL9PnpgNYDS4VwWwR1UYwFFqQcGoxZoLsOlNl1310Hhal/M9nha8KmisYY3fXB7sFmFuoywq9DRthgndqUFF5L3a+FREpe9CQcu1+6xacjsJkdPLvQjMJ/BtgAgJi2d4m+a/1K3Nw/5XE2jI8cYYWzu4NmXvzXznjHE0bMt2Bj9yUCxDJOpjnLzTssf3+LHPrOnWs9upeFbb+UOqvJkWb8+sJprj7FF6xPXGtcj2f+1IIKGjUT3oIEhJ6gIrn+IauhzAQeTgf6FeF0lu/o++V5yBYCknHY4uVeCaNk3SO7zi61XLIEhXvHNs/E1j6maGOWCX02mksu0lOux+eQ0SfFCKNS9RRYWuzzB6ejE/v/T7TohMBQ3H8ylXsJqoDnBGYtvKJLHRlSe9BBjtPLtJm4hUIsjnrpFuXSfgwbsNqj4VggBmeIjg52efWGagprG/W3PGforYXOJvx1Uy3dFjnB25GPSOwtgZgblGaxk2dWTBT5L+NsnZ4Nr1biJ7Dhx9L75QzjstQQLVwhJKurdoSRvJ+vS6KrwPScy0cKw/RK8x93Bwc7PNHBIUoNbiMyVjSRGfG3YuS9jOO3crCHfqwo/s4P62fOGuut9/70+o9qxO7o9CXptCYTgipi9h78xk47CiWjwJ7uqGm0KTQen4ES1EZiRleJ3hdH6HDvPNgyeOP+AdLJ89IMLCnm3ybXD3HQSzY2/n/OircXSHjRZp62XDfuemv4yH8GGS4FHO6XchQzd6gRS6pT4+Vj BtyIIWve TrKWrQrS1PQ2iakwB/TIIWAP6GtbP654OuiV8zmx4CsrqfRNGlTLcy6Nb8kutSO7402jVLdpWj5ABC7bvegLR57N69gywB/i64g81Wwv7ODR2+cb4R6BkGY29IkXD1qDrjr7+f7HRb+IRFuHG3ckwZyOKxqzTp8HiZ/ssRUTjEoovkiBrhniE9M1jiYP9GUw2DqlMEuJ5pwTw73XSX0VDrCILSeWNAyHMPH1mwXdITg4FyXMfxyeD/Uu7byFSgQKzZfcqXS48IaWT+TCLKF7hPz1grkgNqdYI2hOOUxB+69skFTqT0RRhGyfkZ1gkQtwHY2ElUxKJvKSRmwwJH8R4yKb8tqgog6gvrNdJwsLiwKr5ba7zDtVRkcz/+ezbqRKw8WdPJw4ZvkfqREZPds5hm4WlMpnU97I4cLLMHXS58ZIESP2wsaiovitRBhoDJj0WIvAPUOcPw75nTbevNFl0PoL3KLBJLMi+wdPoW6jm6qv4tm4ueuzsgkME8F1mBC8ETgBI8vrR7MmWO0S7mWBueLSYUGwDjTNwNIugkH3IFtY0hVY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This patch moves the check of READ_IMPLIES_EXEC out of do_mmap(), and calls the LSM hooks at the same time. Below is the reason. Some logic may call do_mmap() which adding PROT_EXEC internally when the user controlled READ_IMPLIES_EXEC flag is set, without being aware of the harm this poses to LSM. For example, CVE-2016-10044[1] was reported many years ago, but the remap_file_pages() can still bypass the W^X policy enforced by SELinux[2] for a long time. Adding checks is easy(and has been done in all required call sites for the current version), but there may have more calls to do_mmap() in the future. And moving the security check in do_mmap() will let it in the mmap_write_lock, which slows down the performance and even have deadlocks if someone depends on it. Moving the check of READ_IMPLIES_EXEC out of do_mmap() can keep the LSM hook is called out of the mmap_write_lock, and avoid repeated logic for whether READ_IMPLIES_EXEC should add PROT_EXEC for the mapping or not(In current, the !MMU case won't implies exec if file's mmap_capabilities is not exist, but the security check logic is different). And all known cases that call do_mmap() become secure and anyone who want to apply the READ_IMPLIES_EXEC logic will call the LSM hook correctly. Some minor behavioral changes to call sites to do_mmap() and why they should clearly be fine: mm/util.c and ipc/shm.c: the common case, no changes in behavior. fs/aio.c: have ensured never have PROT_EXEC in the fix of CVE-2016-10044, so no changes in behavior. arch/x86/kernel/shstk.c: must not want to PROT_EXEC in any case. since shadow stack is a stack only store return addresses, execute it is never required. mm/mmap.c: in the history, remap_file_pages won't care about the READ_IMPLIES_EXEC. this side effect is introduced in the emulation version after the deprecated mark exists. The patch only remove the side effect introduced. Link: https://project-zero.issues.chromium.org/issues/42452389 [1] Link: https://lore.kernel.org/all/20240919080905.4506-2-paul@paul-moore.com/ [2] Signed-off-by: Shu Han --- V2: Add RFC tag as lorenzo.stoakes@oracle.com suggested, and refine the comment in patch. V1: https://lore.kernel.org/all/20240925063034.169-1-ebpqwerty472123@gmail.com/ Alternatives: 1. mm: move security_mmap_file() back into do_mmap() https://lore.kernel.org/all/20240925115701.73-1-ebpqwerty472123@gmail.com/ 2. Add sufficient comments for do_mmap() --- include/linux/mm.h | 2 ++ include/linux/security.h | 8 +++---- ipc/shm.c | 2 +- mm/mmap.c | 42 ++++++++++++++++++++++------------ mm/nommu.c | 49 +++++++++++++++++++++++++++++++--------- mm/util.c | 2 +- security/security.c | 41 ++++----------------------------- 7 files changed, 78 insertions(+), 68 deletions(-) base-commit: f89722faa31466ff41aed21bdeb9cf34c2312858 diff --git a/include/linux/mm.h b/include/linux/mm.h index c4b238a20b76..83f334590b06 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3392,6 +3392,8 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, extern unsigned long mmap_region(struct file *file, unsigned long addr, unsigned long len, vm_flags_t vm_flags, unsigned long pgoff, struct list_head *uf); +extern int mmap_check_prot(struct file *file, unsigned long *prot, + unsigned long flags); extern unsigned long do_mmap(struct file *file, unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, vm_flags_t vm_flags, unsigned long pgoff, unsigned long *populate, diff --git a/include/linux/security.h b/include/linux/security.h index c37c32ebbdcd..e061bc9a0331 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -423,8 +423,8 @@ void security_file_free(struct file *file); int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg); int security_file_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg); -int security_mmap_file(struct file *file, unsigned long prot, - unsigned long flags); +int security_mmap_file(struct file *file, unsigned long reqprot, + unsigned long prot, unsigned long flags); int security_mmap_addr(unsigned long addr); int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot, unsigned long prot); @@ -1077,8 +1077,8 @@ static inline int security_file_ioctl_compat(struct file *file, return 0; } -static inline int security_mmap_file(struct file *file, unsigned long prot, - unsigned long flags) +static inline int security_mmap_file(struct file *file, unsigned long reqprot, + unsigned long prot, unsigned long flags) { return 0; } diff --git a/ipc/shm.c b/ipc/shm.c index 3e3071252dac..f1095ee3796d 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -1636,7 +1636,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, sfd->vm_ops = NULL; file->private_data = sfd; - err = security_mmap_file(file, prot, flags); + err = mmap_check_prot(file, &prot, flags); if (err) goto out_fput; diff --git a/mm/mmap.c b/mm/mmap.c index 18fddcce03b8..b8992ee202fe 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1249,8 +1249,36 @@ static inline bool file_mmap_ok(struct file *file, struct inode *inode, return true; } +int mmap_check_prot(struct file *file, unsigned long *prot, + unsigned long flags) +{ + unsigned long req_prot = *prot; + unsigned long new_prot = req_prot; + int err; + + /* + * Does the application expect PROT_READ to imply PROT_EXEC? + * + * (the exception is when the underlying filesystem is noexec + * mounted, in which case we don't add PROT_EXEC.) + */ + if (((req_prot & (PROT_READ | PROT_EXEC)) == PROT_READ) && + (current->personality & READ_IMPLIES_EXEC) && + !(file && path_noexec(&file->f_path))) + new_prot |= PROT_EXEC; + + err = security_mmap_file(file, req_prot, new_prot, flags); + if (err) + return err; + + *prot = new_prot; + return 0; +} + /* * The caller must write-lock current->mm->mmap_lock. + * The caller must ensure security check is not needed or + * call to mmap_check_prot before. */ unsigned long do_mmap(struct file *file, unsigned long addr, unsigned long len, unsigned long prot, @@ -1266,16 +1294,6 @@ unsigned long do_mmap(struct file *file, unsigned long addr, if (!len) return -EINVAL; - /* - * Does the application expect PROT_READ to imply PROT_EXEC? - * - * (the exception is when the underlying filesystem is noexec - * mounted, in which case we don't add PROT_EXEC.) - */ - if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC)) - if (!(file && path_noexec(&file->f_path))) - prot |= PROT_EXEC; - /* force arch specific MAP_FIXED handling in get_unmapped_area */ if (flags & MAP_FIXED_NOREPLACE) flags |= MAP_FIXED; @@ -3198,12 +3216,8 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, flags |= MAP_LOCKED; file = get_file(vma->vm_file); - ret = security_mmap_file(vma->vm_file, prot, flags); - if (ret) - goto out_fput; ret = do_mmap(vma->vm_file, start, size, prot, flags, 0, pgoff, &populate, NULL); -out_fput: fput(file); out: mmap_write_unlock(mm); diff --git a/mm/nommu.c b/mm/nommu.c index 7296e775e04e..96761add1295 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -792,12 +792,6 @@ static int validate_mmap_request(struct file *file, if (path_noexec(&file->f_path)) { if (prot & PROT_EXEC) return -EPERM; - } else if ((prot & PROT_READ) && !(prot & PROT_EXEC)) { - /* handle implication of PROT_EXEC by PROT_READ */ - if (current->personality & READ_IMPLIES_EXEC) { - if (capabilities & NOMMU_MAP_EXEC) - prot |= PROT_EXEC; - } } else if ((prot & PROT_READ) && (prot & PROT_EXEC) && !(capabilities & NOMMU_MAP_EXEC) @@ -810,11 +804,6 @@ static int validate_mmap_request(struct file *file, * privately mapped */ capabilities = NOMMU_MAP_COPY; - - /* handle PROT_EXEC implication by PROT_READ */ - if ((prot & PROT_READ) && - (current->personality & READ_IMPLIES_EXEC)) - prot |= PROT_EXEC; } /* allow the security API to have its say */ @@ -992,6 +981,44 @@ static int do_mmap_private(struct vm_area_struct *vma, return -ENOMEM; } +int mmap_check_prot(struct file *file, unsigned long *prot, + unsigned long flags) +{ + unsigned long req_prot = *prot; + unsigned long new_prot = req_prot; + int err; + + /* + * Does the application expect PROT_READ to imply PROT_EXEC? + * + * (the exception is when the underlying filesystem is noexec + * mounted or the file does not have NOMMU_MAP_EXEC + * (== VM_MAYEXEC), in which case we don't add PROT_EXEC.) + */ + if ((req_prot & (PROT_READ | PROT_EXEC)) != PROT_READ) + goto check; + if (!(current->personality & READ_IMPLIES_EXEC)) + goto check; + if (!file) { + new_prot |= PROT_EXEC; + goto check; + } + if (file->f_op->mmap_capabilities) { + unsigned int caps = file->f_op->mmap_capabilities(file); + + if (!(caps & NOMMU_MAP_EXEC)) + goto check; + new_prot |= PROT_EXEC; + } +check: + err = security_mmap_file(file, req_prot, new_prot, flags); + if (err) + return err; + + *prot = new_prot; + return 0; +} + /* * handle mapping creation for uClinux */ diff --git a/mm/util.c b/mm/util.c index bd283e2132e0..2eb4d6037610 100644 --- a/mm/util.c +++ b/mm/util.c @@ -581,7 +581,7 @@ unsigned long vm_mmap_pgoff(struct file *file, unsigned long addr, unsigned long populate; LIST_HEAD(uf); - ret = security_mmap_file(file, prot, flag); + ret = mmap_check_prot(file, &prot, flag); if (!ret) { if (mmap_write_lock_killable(mm)) return -EINTR; diff --git a/security/security.c b/security/security.c index 4564a0a1e4ef..25556629f588 100644 --- a/security/security.c +++ b/security/security.c @@ -2927,42 +2927,10 @@ int security_file_ioctl_compat(struct file *file, unsigned int cmd, } EXPORT_SYMBOL_GPL(security_file_ioctl_compat); -static inline unsigned long mmap_prot(struct file *file, unsigned long prot) -{ - /* - * Does we have PROT_READ and does the application expect - * it to imply PROT_EXEC? If not, nothing to talk about... - */ - if ((prot & (PROT_READ | PROT_EXEC)) != PROT_READ) - return prot; - if (!(current->personality & READ_IMPLIES_EXEC)) - return prot; - /* - * if that's an anonymous mapping, let it. - */ - if (!file) - return prot | PROT_EXEC; - /* - * ditto if it's not on noexec mount, except that on !MMU we need - * NOMMU_MAP_EXEC (== VM_MAYEXEC) in this case - */ - if (!path_noexec(&file->f_path)) { -#ifndef CONFIG_MMU - if (file->f_op->mmap_capabilities) { - unsigned caps = file->f_op->mmap_capabilities(file); - if (!(caps & NOMMU_MAP_EXEC)) - return prot; - } -#endif - return prot | PROT_EXEC; - } - /* anything on noexec mount won't get PROT_EXEC */ - return prot; -} - /** * security_mmap_file() - Check if mmap'ing a file is allowed * @file: file + * @reqprot: protection requested by user * @prot: protection applied by the kernel * @flags: flags * @@ -2971,11 +2939,10 @@ static inline unsigned long mmap_prot(struct file *file, unsigned long prot) * * Return: Returns 0 if permission is granted. */ -int security_mmap_file(struct file *file, unsigned long prot, - unsigned long flags) +int security_mmap_file(struct file *file, unsigned long reqprot, + unsigned long prot, unsigned long flags) { - return call_int_hook(mmap_file, file, prot, mmap_prot(file, prot), - flags); + return call_int_hook(mmap_file, file, reqprot, prot, flags); } /**