Hoi
Ik wil om verschillende redenenen NU even niet een nieuwe 2.4.24 maken, dus wil ik mijn oude 2.4.23 tree patches voor de do_mremap() bug.
Nu heb ik in de 2.4.24 patch gezien dat dit het stuk is waar het om gaat:
Als ik de code een beetje aanpas, zodat ie generieker wordt en niet naar 2.4.23 etc kijkt, dan hou ik dit over:
Als ik deze patch wil draaien lukt dit niet
:
samba:/opt/test# patch --verbose -p0 < adfasdf
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -urN linux/mm/mremap.c linux/mm/mremap.c
|--- linux/mm/mremap.c 2003-08-25 04:44:44.000000000 -0700
|+++ linux/mm/mremap.c 2004-01-05 05:53:56.000000000 -0800
--------------------------
Patching file linux/mm/mremap.c using Plan A...
Hunk #1 FAILED at 241.
1 out of 1 hunk FAILED -- saving rejects to file linux/mm/mremap.c.rej
Hmm... Ignoring the trailing garbage.
done
Als ik dan is die reject file kijk, zie ik:
Wat is hier nou mis mee
Ik wil om verschillende redenenen NU even niet een nieuwe 2.4.24 maken, dus wil ik mijn oude 2.4.23 tree patches voor de do_mremap() bug.
Nu heb ik in de 2.4.24 patch gezien dat dit het stuk is waar het om gaat:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| diff -urN linux-2.4.23/mm/mremap.c linux-2.4.24/mm/mremap.c
--- linux-2.4.23/mm/mremap.c 2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.24/mm/mremap.c 2004-01-05 05:53:56.000000000 -0800
@@ -241,6 +241,13 @@
if (new_len > TASK_SIZE || new_addr > TASK_SIZE - new_len)
goto out;
+ /*
+ * Allow new_len == 0 only if new_addr == addr
+ * to preserve truncation in place (that was working
+ * safe and some app may depend on it).
+ */
+ if (unlikely(!new_len && new_addr != addr))
+ goto out;
/* Check if the location we're moving into overlaps the
* old location at all, and fail if it does. |
Als ik de code een beetje aanpas, zodat ie generieker wordt en niet naar 2.4.23 etc kijkt, dan hou ik dit over:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| diff -urN linux/mm/mremap.c linux/mm/mremap.c
--- linux/mm/mremap.c 2003-08-25 04:44:44.000000000 -0700
+++ linux/mm/mremap.c 2004-01-05 05:53:56.000000000 -0800
@@ -241,6 +241,13 @@
if (new_len > TASK_SIZE || new_addr > TASK_SIZE - new_len)
goto out;
+ /*
+ * Allow new_len == 0 only if new_addr == addr
+ * to preserve truncation in place (that was working
+ * safe and some app may depend on it).
+ */
+ if (unlikely(!new_len && new_addr != addr))
+ goto out;
/* Check if the location we're moving into overlaps the
* old location at all, and fail if it does. |
Als ik deze patch wil draaien lukt dit niet
samba:/opt/test# patch --verbose -p0 < adfasdf
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -urN linux/mm/mremap.c linux/mm/mremap.c
|--- linux/mm/mremap.c 2003-08-25 04:44:44.000000000 -0700
|+++ linux/mm/mremap.c 2004-01-05 05:53:56.000000000 -0800
--------------------------
Patching file linux/mm/mremap.c using Plan A...
Hunk #1 FAILED at 241.
1 out of 1 hunk FAILED -- saving rejects to file linux/mm/mremap.c.rej
Hmm... Ignoring the trailing garbage.
done
Als ik dan is die reject file kijk, zie ik:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| ***************
*** 241,246 ****
if (new_len > TASK_SIZE || new_addr > TASK_SIZE - new_len)
goto out;
/* Check if the location we're moving into overlaps the
* old location at all, and fail if it does.
--- 241,253 ----
if (new_len > TASK_SIZE || new_addr > TASK_SIZE - new_len)
goto out;
+ /*
+ * Allow new_len == 0 only if new_addr == addr
+ * to preserve truncation in place (that was working
+ * safe and some app may depend on it).
+ */
+ if (unlikely(!new_len && new_addr != addr))
+ goto out;
/* Check if the location we're moving into overlaps the
* old location at all, and fail if it does. |
Wat is hier nou mis mee