1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
11_ignore_CSIn.patch
12_version_suffix.patch
50_initrd.patch
60_bigmem.patch
70_dde.patch
Add-some-padding-to-make-objects-fit-a-single-cache-.patch
vm_cache_policy.patch
0001-XXX.patch
commit 7912cfc77c543de45b2b3e843859e72a48e313f4
Author: Justus Winter <4winter@informatik.uni-hamburg.de>
Date: Wed Jan 21 00:09:10 2015 +0100
ipc: be more pedantic XXX
diff --git a/ipc/mach_port.c b/ipc/mach_port.c
index c7d9b81..7f27533 100644
--- a/ipc/mach_port.c
+++ b/ipc/mach_port.c
@@ -570,7 +570,7 @@ mach_port_destroy(
kr = ipc_right_lookup_write(space, name, &entry);
if (kr != KERN_SUCCESS) {
- if (name != MACH_PORT_NULL && name != MACH_PORT_DEAD && space == current_space()) {
+ if (space == current_space()) {
printf("task %.*s destroying an invalid port %lu, most probably a bug.\n", sizeof current_task()->name, current_task()->name, name);
if (mach_port_deallocate_debug)
SoftDebugger("mach_port_deallocate");
@@ -614,7 +614,7 @@ mach_port_deallocate(
kr = ipc_right_lookup_write(space, name, &entry);
if (kr != KERN_SUCCESS) {
- if (name != MACH_PORT_NULL && name != MACH_PORT_DEAD && space == current_space()) {
+ if (space == current_space()) {
printf("task %.*s deallocating an invalid port %lu, most probably a bug.\n", sizeof current_task()->name, current_task()->name, name);
if (mach_port_deallocate_debug)
SoftDebugger("mach_port_deallocate");
@@ -735,8 +735,14 @@ mach_port_mod_refs(
return KERN_INVALID_VALUE;
kr = ipc_right_lookup_write(space, name, &entry);
- if (kr != KERN_SUCCESS)
+ if (kr != KERN_SUCCESS) {
+ if (space == current_space()) {
+ printf("task %.*s frobnicating an invalid port %lu, most probably a bug.\n", sizeof current_task()->name, current_task()->name, name);
+ if (mach_port_deallocate_debug)
+ SoftDebugger("mach_port_mod_refs");
+ }
return kr;
+ }
/* space is write-locked and active */
kr = ipc_right_delta(space, name, entry, right, delta); /* unlocks */
|