shithub: riscv

Download patch

ref: a0879abae40625f586a0af5621e7a29f8b5a568f
parent: efd64da989f1b6585e5413b1b61413509ae49eaf
author: cinap_lenrek <[email protected]>
date: Sat Mar 7 18:58:47 EST 2020

devproc: don't allow /proc/$pid/ctl to be opens for reading

--- a/sys/src/9/port/devproc.c
+++ b/sys/src/9/port/devproc.c
@@ -447,7 +447,6 @@
 	case Qnoteid:
 		if(omode == OREAD)
 			break;
-	case Qctl:
 	case Qnote:
 		if(p->kp)
 			error(Eperm);
@@ -457,6 +456,11 @@
 		if(p->kp || omode != OWRITE)
 			error(Eperm);
 		pid = p->noteid;
+		break;
+
+	case Qctl:
+		if(p->kp || omode != OWRITE)
+			error(Eperm);
 		break;
 
 	case Qmem: