Date: Thu, 8 Mar 2018 17:04:36 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330663 - head/sys/kern Message-ID: <201803081704.w28H4aQx052056@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Thu Mar 8 17:04:36 2018 New Revision: 330663 URL: https://svnweb.freebsd.org/changeset/base/330663 Log: Return E2BIG if we run out of space writing a compressed kernel dump. ENOSPC causes the MD kernel dump code to retry the dump, but this is undesirable in the case where we legitimately ran out of space. Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Thu Mar 8 16:27:31 2018 (r330662) +++ head/sys/kern/kern_shutdown.c Thu Mar 8 17:04:36 2018 (r330663) @@ -1115,6 +1115,12 @@ dump_check_bounds(struct dumperinfo *di, off_t offset, if (length != 0 && (offset < di->mediaoffset || offset - di->mediaoffset + length > di->mediasize)) { + if (di->kdcomp != NULL && offset >= di->mediaoffset) { + printf( + "Compressed dump failed to fit in device boundaries.\n"); + return (E2BIG); + } + printf("Attempt to write outside dump device boundaries.\n" "offset(%jd), mediaoffset(%jd), length(%ju), mediasize(%jd).\n", (intmax_t)offset, (intmax_t)di->mediaoffset,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803081704.w28H4aQx052056>