Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Jul 2020 15:06:49 -0700
From:      Xin Li <delphij@delphij.net>
To:        freebsd-current@freebsd.org
Subject:   Re: Is there any error checking on swap?
Message-ID:  <a5b48324-c02c-b087-7da4-be66e447599f@delphij.net>
In-Reply-To: <20200712072911.GG4213@funkthat.com>
References:  <20200712033332.GA63411@www.zefox.net> <20200712072911.GG4213@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--LMnbsEF8WeMUkozyo6orSrKHBIwGgugr0
Content-Type: multipart/mixed; boundary="UGCJhs9mWmeFod3EV4IksQZz4eH5wRmpc";
 protected-headers="v1"
From: Xin Li <delphij@delphij.net>
Reply-To: d@delphij.net
To: freebsd-current@freebsd.org
Message-ID: <a5b48324-c02c-b087-7da4-be66e447599f@delphij.net>
Subject: Re: Is there any error checking on swap?
References: <20200712033332.GA63411@www.zefox.net>
 <20200712072911.GG4213@funkthat.com>
In-Reply-To: <20200712072911.GG4213@funkthat.com>

--UGCJhs9mWmeFod3EV4IksQZz4eH5wRmpc
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable



On 7/12/20 12:29 AM, John-Mark Gurney wrote:
> bob prohaska wrote this message on Sat, Jul 11, 2020 at 20:33 -0700:
>> Is there any error checking on swap traffic, along the lines of
>> a checksum or parity test?=20
>>
>> Just curious what happens if a page written out is corrupted  when
>> it comes back.
>=20
> Looks like it doesn't:
> https://svnweb.freebsd.org/base/head/sys/vm/swap_pager.c?annotate=3D361=
965#l1389

Technically one can enable checks with e.g. geli(8), but note that the
geli(8) provider will not "prime" the HMAC data so attaching the device
will immediately spam the system log with some authentication errors due
to GEOM tasting (because the kernel would try to read locations that
potentially contain metadata for other GEOM providers).

For the case of swap, since the write is always page sized, it's
probably optimal to implement something in the swap layer itself and
store the expected checksums in memory.

Cheers,


--UGCJhs9mWmeFod3EV4IksQZz4eH5wRmpc--

--LMnbsEF8WeMUkozyo6orSrKHBIwGgugr0
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.2.20 (FreeBSD)

iQIzBAEBCgAdFiEEceNg5NEMZIki80nQQHl/fJX0g08FAl8LiX0ACgkQQHl/fJX0
g09xQQ//UXdeg1WXxoi0WQR8Dr1xwLeKUhW+KULfN3wuH0M8feIcVZca033Ra8w4
rMdx9HF7H87vbgUb4Cw1UfcAyLgJSbQ09tV0m3O6NRgI9E9Awfys0vVIOnpvrcI7
R1VTHqYqiI2iKuaxf0aY/YVoMQWXGeP7G45dKUk/jhXC9XfSphhep0xUOacm7cyp
W14uIn8mDeEyHCjEByxfuZ3Xefg8cO7hwcgDCRY3qK+Wd3D1hOwRvQkPSbzTyLJA
QITqqZFnGbiTTpSO+IIkmFdH+HfvM7R6lZOuNAC7PG0+0neosCG82wRwH2XTzRhz
g49dWL+NXheTJhaTQ5CStMZw3dnNafm9nuxLkA2OtHuRsVYmJUHXj9ynRAVJd8dA
A/G/6Dk9mtkZW+cIEft0jqmF9iVdv/pPH/efyJaJtarabr8rZztefn8vbZ5P6pKW
nAZLcSBdGo1AhVaGEaK9dneQ1mFn7DFsQBjv1gGYPR3TKXXC4GfbZWTLlapiAZ8U
BaIYtk6YgR819w21Qk0OBNh+zTLuAxTpwMJo02xOTgPRbIZ9b5hzR+c7MlIULlvY
6mBiB4omc5lqvWRC+8QR/kFXTMxkrghA405uiBwX+z9s8EEdJuOaNm948GqGxW7N
Hn4PNyUFyILqiRUGTlUL3jSPq4O3jLl7L+wJ+Y6XFx32qrN8RC8=
=cW4G
-----END PGP SIGNATURE-----

--LMnbsEF8WeMUkozyo6orSrKHBIwGgugr0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a5b48324-c02c-b087-7da4-be66e447599f>