Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2019 15:51:01 -0800
From:      David Wolfskill <david@catwhisker.org>
To:        hackers@freebsd.org
Subject:   Re: I seem to be getting mixed messages from savecore(8)
Message-ID:  <20191210235101.GG27431@albert.catwhisker.org>
In-Reply-To: <20191208224712.GC1227@albert.catwhisker.org>
References:  <20191208224712.GC1227@albert.catwhisker.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--qoTlaiD+Y2fIM3Ll
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

In case anyone is interested, for the archives:

On Sun, Dec 08, 2019 at 02:47:12PM -0800, David Wolfskill wrote:
> ...
> So: If I understand correctly, "savecore -C" detacts that a dump exists
> on the cited device, but invoking savecore to actually ... save ... the
> dump does not actually do that.

The observed behavior is a result of attempting to implement encrypted
swap:  I had successfully arranged to swap to /dev/nda0p5.eli;
apparently performing a read-only open of /dev/nda0p5:

=2E..
   1062 int
   1063 main(int argc, char **argv)
   1064 {
=2E..
   1027         /*
   1028          * The fileargs capability does not currently provide a way=
 to limit
   1029          * ioctls.
   1030          */
   1031         (void)cap_rights_init(&rights, CAP_PREAD, CAP_WRITE, CAP_IO=
CTL);
   1032         capfa =3D fileargs_init(argc, argv, checkfor || keep ? O_RD=
ONLY : O_RDWR,
   1033             0, &rights, FA_OPEN);
   1034         if (capfa =3D=3D NULL) {
   1035                 logmsg(LOG_ERR, "fileargs_init(): %m");
   1036                 exit(1);
   1037         }

=2E..
    578 static void
    579 DoFile(const char *savedir, int savedirfd, const char *device)
    580 {
=2E..
    618         if (verbose)
    619                 printf("checking for kernel dump on device %s\n", d=
evice);
    620=20
    621         fddev =3D fileargs_open(capfa, device);
    622         if (fddev < 0) {
    623                 logmsg(LOG_ERR, "%s: %m", device);
    624                 return;
    625         }
=2E...


is OK, but read/write ... is not.  (Which is not unreasonable.)

> Any suggestions for expressing my request in a way that savecore is a
> bit more likely to accept?

My revised appraoch is to run savecore before starting swapping on
the device (via swapon).  That appears to work, though I don't know
if that may cause a problem later on.

(In this environment, swapon is being invoked explicitly in an
/etc/rc.d script, rather than by virtue of /etc/fstab entrues (for
example).)

Peace,
david
--=20
David H. Wolfskill				david@catwhisker.org
Some might think an oath of office is as meaningful as a marriage vow.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.

--qoTlaiD+Y2fIM3Ll
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQGTBAEBCgB9FiEE4owz2QxMJyaxAefyQLJg+bY2PckFAl3wL2VfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUy
OEMzM0Q5MEM0QzI3MjZCMTAxRTdGMjQwQjI2MEY5QjYzNjNEQzkACgkQQLJg+bY2
PcmvRQgApHs2fa2dKETczr0xjUzBPpc52fRladE8RoU2LYk+kx+K1fZBT7fS9fHC
94RAZoOiR68bvaMW98OZ6pMFk19edCd59tfSbalvDPD1UMmy+Nq5eLFT2duGJDWI
GoEhY5/RUy9EsWnljpS6k7SHzK+8NRq38PGh2ih2FlgIdGyhMonO5W2mc1RSKgpA
+LagxvY/AmBS823nH1c+1cWI7nNdZILIj7gggScILUHueWeGnZWy9mp7HopdtB88
BoiBB8FWMK3hQ+sMjv5fpe26eH/8UP2HUC85dVizQxq6Dzuvk+jgJdvm9qLiAWAy
SrqJeNbtRKjvPZHVf8myqRWN7G5srA==
=3wTZ
-----END PGP SIGNATURE-----

--qoTlaiD+Y2fIM3Ll--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191210235101.GG27431>