Date: Sat, 1 Dec 2012 23:56:33 +0100 From: Nick Hibma <nick@van-laarhoven.org> To: Paul Schenkeveld <freebsd@psconsult.nl> Cc: freebsd-embedded@freebsd.org Subject: Re: NanoBSD: Create image sparsely Message-ID: <6BD4F6F8-8D8B-4150-B7A6-C47900C27A06@van-laarhoven.org> In-Reply-To: <20121130010403.GA82618@psconsult.nl> References: <42654855-CF29-488A-A645-2A280FC9D074@van-laarhoven.org> <20121130010403.GA82618@psconsult.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
> When copying sparsely, blocks containing zeroes are not copied over = but > skipped using lseek. When the output file is a newly created regular > file this is OK because sparse blocks read as zeroes. >=20 > But here nanobsd.sh writes to a md(4) device which does not contain > zeroes when created as a swap based device (NANO_MD_BACKING=3Dswap). = When > a file on ${MD}s1 contains a block that deliberately contains zeroes > the resulting copy is not the same as the original which may cause all > kinds of problems. Only when ${MD}s1 is created as a file based = device, > blocks seeked over will read back as zeroes. >=20 > Earlier this month I started a thread on freebsd-security@ related to > this issue (subject: md(4) (swap-base) disks not cleaned on creation) > and the patch by Konstantin Belousov will solve this problem but that > leaves all systems before this patch vulnerable to this problem. Are you referring to the recent commit that bzero's a page when a new = page is created by the pager (instead of an existing one returned)? Well, if my commit follows that commit (making sure that the MFC does = not precede it either) we should be fine. NanoBSD is provided in the = FreeBSD source tree. Nick=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6BD4F6F8-8D8B-4150-B7A6-C47900C27A06>