[PATCH v2 4/4] ubifs: prevent remounting rw when no hmac key was given

Richard Weinberger richard at nod.at
Fri Jun 26 08:27:21 EDT 2020


----- Ursprüngliche Mail -----
> Von: "Torben Hohn" <torben.hohn at linutronix.de>
> An: "richard" <richard at nod.at>
> CC: "bigeasy" <bigeasy at linutronix.de>, "tglx" <tglx at linutronix.de>, "linux-mtd" <linux-mtd at lists.infradead.org>, "Sascha
> Hauer" <s.hauer at pengutronix.de>
> Gesendet: Freitag, 26. Juni 2020 13:29:07
> Betreff: [PATCH v2 4/4] ubifs: prevent remounting rw when no hmac key was given

> After adding readonly hmac-less authentication support,
> prevent remounting the filesystem in rw mode, when
> the hmac is not available.
> 
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
> ---
> fs/ubifs/super.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index b41ca9ee5763..62bdef8f1ddf 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -1996,6 +1996,10 @@ static int ubifs_remount_fs(struct super_block *sb, int
> *flags, char *data)
> 			ubifs_msg(c, "cannot re-mount R/W - UBI volume is R/O");
> 			return -EROFS;
> 		}
> +		if (ubifs_authenticated(c) && !c->hash_tfm) {
> +			ubifs_msg(c, "cannot re-mount R/W due to missing hmac key, for
> authentication");
> +			return -EROFS;
> +		}

But the case that one remounts rw and provides a HAMC is handled?

Thanks,
//richard



More information about the linux-mtd mailing list