1 diff -urN 2.6.0-test10-orig_1/ipc/msg.c 2.6.0-test10-patched_1/ipc/msg.c
2 --- 2.6.0-test10-orig_1/ipc/msg.c 2003-11-07 17:07:13.000000000 +0100
3 +++ 2.6.0-test10-patched_1/ipc/msg.c 2003-11-21 17:11:17.000000000 +0100
5 struct task_struct* tsk;
9 - struct msg_msgseg* next;
10 - /* the next part of the message follows immediately */
14 #define SEARCH_EQUAL 2
15 #define SEARCH_NOTEQUAL 3
17 return msg_buildid(id,msq->q_perm.seq);
20 -static void free_msg(struct msg_msg* msg)
22 - struct msg_msgseg* seg;
24 - security_msg_msg_free(msg);
28 - while(seg != NULL) {
29 - struct msg_msgseg* tmp = seg->next;
35 -static struct msg_msg* load_msg(void* src, int len)
37 - struct msg_msg* msg;
38 - struct msg_msgseg** pseg;
43 - if(alen > DATALEN_MSG)
46 - msg = (struct msg_msg *) kmalloc (sizeof(*msg) + alen, GFP_KERNEL);
48 - return ERR_PTR(-ENOMEM);
51 - msg->security = NULL;
53 - if (copy_from_user(msg+1, src, alen)) {
59 - src = ((char*)src)+alen;
62 - struct msg_msgseg* seg;
64 - if(alen > DATALEN_SEG)
66 - seg = (struct msg_msgseg *) kmalloc (sizeof(*seg) + alen, GFP_KERNEL);
73 - if(copy_from_user (seg+1, src, alen)) {
79 - src = ((char*)src)+alen;
82 - err = security_msg_msg_alloc(msg);
90 - return ERR_PTR(err);
93 -static int store_msg(void* dest, struct msg_msg* msg, int len)
96 - struct msg_msgseg *seg;
99 - if(alen > DATALEN_MSG)
100 - alen = DATALEN_MSG;
101 - if(copy_to_user (dest, msg+1, alen))
105 - dest = ((char*)dest)+alen;
109 - if(alen > DATALEN_SEG)
110 - alen = DATALEN_SEG;
111 - if(copy_to_user (dest, seg+1, alen))
114 - dest = ((char*)dest)+alen;
120 static inline void ss_add(struct msg_queue* msq, struct msg_sender* mss)
123 diff -urN 2.6.0-test10-orig_1/ipc/util.c 2.6.0-test10-patched_1/ipc/util.c
124 --- 2.6.0-test10-orig_1/ipc/util.c 2003-11-07 17:07:13.000000000 +0100
125 +++ 2.6.0-test10-patched_1/ipc/util.c 2003-11-21 17:11:17.000000000 +0100
126 @@ -611,3 +611,107 @@
129 #endif /* CONFIG_SYSVIPC */
131 +#ifdef CONFIG_SYSVIPC
133 +void free_msg(struct msg_msg* msg)
135 + struct msg_msgseg* seg;
137 + security_msg_msg_free(msg);
141 + while(seg != NULL) {
142 + struct msg_msgseg* tmp = seg->next;
148 +struct msg_msg* load_msg(void* src, int len)
150 + struct msg_msg* msg;
151 + struct msg_msgseg** pseg;
156 + if(alen > DATALEN_MSG)
157 + alen = DATALEN_MSG;
159 + msg = (struct msg_msg *) kmalloc (sizeof(*msg) + alen, GFP_KERNEL);
161 + return ERR_PTR(-ENOMEM);
164 + msg->security = NULL;
166 + if (copy_from_user(msg+1, src, alen)) {
172 + src = ((char*)src)+alen;
175 + struct msg_msgseg* seg;
177 + if(alen > DATALEN_SEG)
178 + alen = DATALEN_SEG;
179 + seg = (struct msg_msgseg *) kmalloc (sizeof(*seg) + alen, GFP_KERNEL);
186 + if(copy_from_user (seg+1, src, alen)) {
192 + src = ((char*)src)+alen;
195 + err = security_msg_msg_alloc(msg);
203 + return ERR_PTR(err);
206 +int store_msg(void* dest, struct msg_msg* msg, int len)
209 + struct msg_msgseg *seg;
212 + if(alen > DATALEN_MSG)
213 + alen = DATALEN_MSG;
214 + if(copy_to_user (dest, msg+1, alen))
218 + dest = ((char*)dest)+alen;
222 + if(alen > DATALEN_SEG)
223 + alen = DATALEN_SEG;
224 + if(copy_to_user (dest, seg+1, alen))
227 + dest = ((char*)dest)+alen;
233 +#endif /* CONFIG_SYSVIPC */
234 diff -urN 2.6.0-test10-orig_1/ipc/util.h 2.6.0-test10-patched_1/ipc/util.h
235 --- 2.6.0-test10-orig_1/ipc/util.h 2003-11-07 17:07:13.000000000 +0100
236 +++ 2.6.0-test10-patched_1/ipc/util.h 2003-11-21 17:11:17.000000000 +0100
238 struct kern_ipc_perm* p;
242 + struct msg_msgseg* next;
243 + /* the next part of the message follows immediately */
246 +void free_msg(struct msg_msg* msg);
247 +struct msg_msg* load_msg(void* src, int len);
248 +int store_msg(void* dest, struct msg_msg* msg, int len);
251 void __init ipc_init_ids(struct ipc_ids* ids, int size);
253 /* must be called with ids->sem acquired.*/