X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=kernel-vserver-2.3.patch;h=07ea4ba01fa79e725c4e3faff7227d33ac038f4d;hb=d12544d8ec642d5d8f2ef771b1109cc2eec26d91;hp=e2db62d5c82b9faee85eb4b658a773527055f0dc;hpb=bc6416242220d3fc039ceb706d17ac05cdb7d489;p=packages%2Fkernel.git diff --git a/kernel-vserver-2.3.patch b/kernel-vserver-2.3.patch index e2db62d5..07ea4ba0 100644 --- a/kernel-vserver-2.3.patch +++ b/kernel-vserver-2.3.patch @@ -3604,18 +3604,18 @@ diff -NurpP --minimal linux-4.9.135/fs/libfs.c linux-4.9.135-vs2.3.9.8/fs/libfs. struct dentry *dentry = file->f_path.dentry; struct dentry *cursor = file->private_data; @@ -194,9 +195,10 @@ int dcache_readdir(struct file *file, st - if (ctx->pos == 2) - p = &dentry->d_subdirs; - while ((next = next_positive(dentry, p, 1)) != NULL) { + p = &cursor->d_child; + + while ((p = scan_positives(cursor, p, 1, &next)) != anchor) { - if (!dir_emit(ctx, next->d_name.name, next->d_name.len, + if (!filter || filter(next)) + if (!dir_emit(ctx, next->d_name.name, next->d_name.len, d_inode(next)->i_ino, dt_type(d_inode(next)))) - break; + break; - moved = true; - p = &next->d_child; ctx->pos++; + } + spin_lock(&dentry->d_lock); @@ -205,8 +207,22 @@ int dcache_readdir(struct file *file, st move_cursor(cursor, p); return 0; @@ -12712,12 +12712,16 @@ diff -NurpP --minimal linux-4.9.135/ipc/mqueue.c linux-4.9.135-vs2.3.9.8/ipc/mqu } else if (S_ISDIR(mode)) { inc_nlink(inode); /* Some things misbehave if size == 0 on a directory */ -@@ -396,8 +404,11 @@ static void mqueue_evict_inode(struct in - +@@ -402,6 +402,7 @@ static void mqueue_evict_inode(struct in user = info->user; if (user) { + unsigned long mq_bytes, mq_treesize; + struct vx_info *vxi = info->vxi; -+ + + /* Total amount of bytes accounted for the mqueue */ + mq_treesize = info->attr.mq_maxmsg * sizeof(struct msg_msg) + +@@ -413,6 +414,7 @@ static void mqueue_evict_inode(struct in + spin_lock(&mq_lock); user->mq_bytes -= mq_bytes; + vx_ipcmsg_sub(vxi, user, mq_bytes); @@ -13568,14 +13572,15 @@ diff -NurpP --minimal linux-4.9.135/kernel/ptrace.c linux-4.9.135-vs2.3.9.8/kern #include #include #include -@@ -325,6 +326,11 @@ ok: - !ptrace_has_cap(mm->user_ns, mode))) - return -EPERM; +@@ -331,6 +331,12 @@ ok: + if (mode & PTRACE_MODE_SCHED) + return 0; ++ + if (!vx_check(task->xid, VS_ADMIN_P|VS_WATCH_P|VS_IDENT)) + return -EPERM; + if (!vx_check(task->xid, VS_IDENT) && -+ !task_vx_flags(task, VXF_STATE_ADMIN, 0)) ++ !task_vx_flags(task, VXF_STATE_ADMIN, 0)) + return -EACCES; return security_ptrace_access_check(task, mode); }