patch-2.3.14 linux/fs/proc/array.c

Next file: linux/fs/ufs/truncate.c
Previous file: linux/fs/partitions/ultrix.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.13/linux/fs/proc/array.c linux/fs/proc/array.c
@@ -78,6 +78,11 @@
 #endif
 
 
+static int open_kcore(struct inode * inode, struct file * filp)
+{
+	return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
+}
+
 static ssize_t read_core(struct file * file, char * buf,
 			 size_t count, loff_t *ppos)
 {
@@ -139,6 +144,12 @@
 static struct file_operations proc_kcore_operations = {
 	NULL,           /* lseek */
 	read_core,
+	NULL,		/* write */
+	NULL,		/* readdir */
+	NULL,		/* poll */
+	NULL,		/* ioctl */
+	NULL,		/* mmap */
+	open_kcore
 };
 
 struct inode_operations proc_kcore_inode_operations = {
@@ -546,7 +557,7 @@
 	    int count = 0;
 
 	    stack_page = (unsigned long)p;
-	    fp = ((struct switch_stack *)p->tss.ksp)->a6;
+	    fp = ((struct switch_stack *)p->thread.ksp)->a6;
 	    do {
 		    if (fp < stack_page+sizeof(struct task_struct) ||
 			fp >= 8184+stack_page)
@@ -639,11 +650,11 @@
 #define	KSTK_EIP(tsk)	\
     ({			\
 	unsigned long eip = 0;	 \
-	if ((tsk)->tss.esp0 > PAGE_SIZE && \
-	    MAP_NR((tsk)->tss.esp0) < max_mapnr) \
-	      eip = ((struct pt_regs *) (tsk)->tss.esp0)->pc;	 \
+	if ((tsk)->thread.esp0 > PAGE_SIZE && \
+	    MAP_NR((tsk)->thread.esp0) < max_mapnr) \
+	      eip = ((struct pt_regs *) (tsk)->thread.esp0)->pc; \
 	eip; })
-#define	KSTK_ESP(tsk)	((tsk) == current ? rdusp() : (tsk)->tss.usp)
+#define	KSTK_ESP(tsk)	((tsk) == current ? rdusp() : (tsk)->thread.usp)
 #elif defined(__powerpc__)
 #define KSTK_EIP(tsk)	((tsk)->tss.regs->nip)
 #define KSTK_ESP(tsk)	((tsk)->tss.regs->gpr[1])

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)