summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2023-04-25 10:06:13 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2023-04-25 10:06:13 +0000
commitdc63cea9b385af61a96d372851ebf3ae57d5981e (patch)
treed57e4631c4cc392d9afd966588d887f267b760cc /sys
parent1426b597507f56592386b2d933dbacd4351b10d1 (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. amd64 BIOS bits first, rest to come. Crank minor. "seems sensible" jsing
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/stand/boot/conf.c4
-rw-r--r--sys/arch/amd64/stand/cdboot/conf.c4
-rw-r--r--sys/arch/amd64/stand/libsa/biosdev.c4
-rw-r--r--sys/arch/amd64/stand/pxeboot/conf.c4
4 files changed, 9 insertions, 7 deletions
diff --git a/sys/arch/amd64/stand/boot/conf.c b/sys/arch/amd64/stand/boot/conf.c
index ac2bf3bd958..00176599d62 100644
--- a/sys/arch/amd64/stand/boot/conf.c
+++ b/sys/arch/amd64/stand/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.55 2022/08/12 20:18:58 stsp Exp $ */
+/* $OpenBSD: conf.c,v 1.56 2023/04/25 10:06:12 kn Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -41,7 +41,7 @@
#include <biosdev.h>
#include <dev/cons.h>
-const char version[] = "3.55";
+const char version[] = "3.56";
int debug = 1;
diff --git a/sys/arch/amd64/stand/cdboot/conf.c b/sys/arch/amd64/stand/cdboot/conf.c
index f376f5fffc0..654825fd64c 100644
--- a/sys/arch/amd64/stand/cdboot/conf.c
+++ b/sys/arch/amd64/stand/cdboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.49 2022/08/12 20:18:58 stsp Exp $ */
+/* $OpenBSD: conf.c,v 1.50 2023/04/25 10:06:12 kn Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -42,7 +42,7 @@
#include <biosdev.h>
#include <dev/cons.h>
-const char version[] = "3.55";
+const char version[] = "3.56";
int debug = 1;
diff --git a/sys/arch/amd64/stand/libsa/biosdev.c b/sys/arch/amd64/stand/libsa/biosdev.c
index 4e56de62c43..f669d169fd7 100644
--- a/sys/arch/amd64/stand/libsa/biosdev.c
+++ b/sys/arch/amd64/stand/libsa/biosdev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosdev.c,v 1.35 2022/08/12 20:17:46 stsp Exp $ */
+/* $OpenBSD: biosdev.c,v 1.36 2023/04/25 10:06:12 kn Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -533,6 +533,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/amd64/stand/pxeboot/conf.c b/sys/arch/amd64/stand/pxeboot/conf.c
index da7347520a4..290d50f001f 100644
--- a/sys/arch/amd64/stand/pxeboot/conf.c
+++ b/sys/arch/amd64/stand/pxeboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.54 2022/08/12 20:18:58 stsp Exp $ */
+/* $OpenBSD: conf.c,v 1.55 2023/04/25 10:06:12 kn Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -44,7 +44,7 @@
#include "pxeboot.h"
#include "pxe_net.h"
-const char version[] = "3.55";
+const char version[] = "3.56";
int debug = 0;
void (*sa_cleanup)(void) = pxe_shutdown;