summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2023-04-25 14:48:18 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2023-04-25 14:48:18 +0000
commit0125897f9c9d1e7defc76426166860d41cf18b02 (patch)
treeeff1ec0c453010043fd39b33cf2b813209dd2fe7
parent1804bfc30995d96e485ba0e4479adbc8898be1e8 (diff)
Do not attempt to write to read-only softraid
Bootloaders have no write support for softraid volumes, which manifests in, e.g. /bsd.upgrade not being stripped of its 'x' permission bit to prevent sysupgrade loops in case of upgrade failure. Set a no-write flag handled by libsa to bail out early in write calls. There should be no real behaviour change, writes just fail earlier now. i386 BIOS. Crank minor. Tested inside amd64 vmm.
-rw-r--r--sys/arch/i386/stand/boot/conf.c4
-rw-r--r--sys/arch/i386/stand/cdboot/conf.c4
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.c4
-rw-r--r--sys/arch/i386/stand/pxeboot/conf.c4
4 files changed, 9 insertions, 7 deletions
diff --git a/sys/arch/i386/stand/boot/conf.c b/sys/arch/i386/stand/boot/conf.c
index ab2cf8b81cd..f76ffad2c53 100644
--- a/sys/arch/i386/stand/boot/conf.c
+++ b/sys/arch/i386/stand/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.76 2020/12/09 18:10:18 krw Exp $ */
+/* $OpenBSD: conf.c,v 1.77 2023/04/25 14:48:16 kn Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -42,7 +42,7 @@
#include <dev/cons.h>
#include "debug.h"
-const char version[] = "3.44";
+const char version[] = "3.45";
int debug = 1;
diff --git a/sys/arch/i386/stand/cdboot/conf.c b/sys/arch/i386/stand/cdboot/conf.c
index 04444293a3b..e18d8ba325f 100644
--- a/sys/arch/i386/stand/cdboot/conf.c
+++ b/sys/arch/i386/stand/cdboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.43 2020/12/09 18:10:18 krw Exp $ */
+/* $OpenBSD: conf.c,v 1.44 2023/04/25 14:48:17 kn Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -43,7 +43,7 @@
#include <dev/cons.h>
#include "debug.h"
-const char version[] = "3.44";
+const char version[] = "3.45";
int debug = 1;
void (*sa_cleanup)(void) = NULL;
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c
index d4031c4608e..03f689d6271 100644
--- a/sys/arch/i386/stand/libsa/biosdev.c
+++ b/sys/arch/i386/stand/libsa/biosdev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosdev.c,v 1.100 2020/12/09 18:10:18 krw Exp $ */
+/* $OpenBSD: biosdev.c,v 1.101 2023/04/25 14:48:17 kn Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -534,6 +534,8 @@ biosopen(struct open_file *f, ...)
#ifdef SOFTRAID
/* Intercept softraid disks. */
if (strncmp("sr", dev, 2) == 0) {
+ /* We only support read-only softraid. */
+ f->f_flags |= F_NOWRITE;
/* Create a fake diskinfo for this softraid volume. */
SLIST_FOREACH(bv, &sr_volumes, sbv_link)
diff --git a/sys/arch/i386/stand/pxeboot/conf.c b/sys/arch/i386/stand/pxeboot/conf.c
index 81f0b6673b2..f022641757b 100644
--- a/sys/arch/i386/stand/pxeboot/conf.c
+++ b/sys/arch/i386/stand/pxeboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.48 2020/12/09 18:10:18 krw Exp $ */
+/* $OpenBSD: conf.c,v 1.49 2023/04/25 14:48:17 kn Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -45,7 +45,7 @@
#include "pxeboot.h"
#include "pxe_net.h"
-const char version[] = "3.44";
+const char version[] = "3.45";
int debug = 1;
void (*sa_cleanup)(void) = pxe_shutdown;