summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-01-02 10:17:29 +0000
committerache <ache@FreeBSD.org>1994-01-02 10:17:29 +0000
commit44196ffe13e5376b5162406170953832ebc8a828 (patch)
tree765a9ef6c67de02a012e2b3c1ebcc3d3d3a6b0b3
parentdc0d9c2d73e23a1c5330c00d7f6dc652edbffcdc (diff)
downloadFreeBSD-src-44196ffe13e5376b5162406170953832ebc8a828.zip
FreeBSD-src-44196ffe13e5376b5162406170953832ebc8a828.tar.gz
Temporary plug CLOCAL security hole, while sticky bits
yet not implemented. Only for bidirectional case.
-rw-r--r--sys/dev/sio/sio.c12
-rw-r--r--sys/i386/isa/sio.c12
-rw-r--r--sys/isa/sio.c12
3 files changed, 33 insertions, 3 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 1311367..8081ae5 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.19 1993/12/13 13:20:50 davidg Exp $
+ * $Id: sio.c,v 1.20 1993/12/16 04:38:27 ache Exp $
*/
#include "sio.h"
@@ -1034,6 +1034,16 @@ sioioctl(dev, cmd, data, flag, p)
iobase = com->iobase;
s = spltty();
+
+#ifdef COM_BIDIR
+ /* XXX: plug security hole while stucky bits not yet implemented */
+
+ if (com->bidir && com->active_in && p->p_ucred->cr_uid != 0) {
+ tp->t_cflag |= HUPCL;
+ tp->t_cflag &= ~CLOCAL;
+ }
+#endif
+
switch (cmd) {
case TIOCSBRK:
outb(iobase + com_cfcr, com->cfcr_image |= CFCR_SBREAK);
diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c
index 1311367..8081ae5 100644
--- a/sys/i386/isa/sio.c
+++ b/sys/i386/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.19 1993/12/13 13:20:50 davidg Exp $
+ * $Id: sio.c,v 1.20 1993/12/16 04:38:27 ache Exp $
*/
#include "sio.h"
@@ -1034,6 +1034,16 @@ sioioctl(dev, cmd, data, flag, p)
iobase = com->iobase;
s = spltty();
+
+#ifdef COM_BIDIR
+ /* XXX: plug security hole while stucky bits not yet implemented */
+
+ if (com->bidir && com->active_in && p->p_ucred->cr_uid != 0) {
+ tp->t_cflag |= HUPCL;
+ tp->t_cflag &= ~CLOCAL;
+ }
+#endif
+
switch (cmd) {
case TIOCSBRK:
outb(iobase + com_cfcr, com->cfcr_image |= CFCR_SBREAK);
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index 1311367..8081ae5 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.19 1993/12/13 13:20:50 davidg Exp $
+ * $Id: sio.c,v 1.20 1993/12/16 04:38:27 ache Exp $
*/
#include "sio.h"
@@ -1034,6 +1034,16 @@ sioioctl(dev, cmd, data, flag, p)
iobase = com->iobase;
s = spltty();
+
+#ifdef COM_BIDIR
+ /* XXX: plug security hole while stucky bits not yet implemented */
+
+ if (com->bidir && com->active_in && p->p_ucred->cr_uid != 0) {
+ tp->t_cflag |= HUPCL;
+ tp->t_cflag &= ~CLOCAL;
+ }
+#endif
+
switch (cmd) {
case TIOCSBRK:
outb(iobase + com_cfcr, com->cfcr_image |= CFCR_SBREAK);
OpenPOWER on IntegriCloud