From: Karel Zak Date: Thu, 17 Jun 2010 08:57:47 +0000 (+0200) Subject: mkswap: don't use too small user-specified page size X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=630161f2715af033667a1398c9f1d2b87eaf61f9;p=util-linux mkswap: don't use too small user-specified page size Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=601552 Signed-off-by: Karel Zak --- diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index 25a920ad..93378076 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -153,7 +153,7 @@ init_signature_page(void) { if (user_pagesize) { if ((user_pagesize & (user_pagesize-1)) || - user_pagesize < 1024) { + user_pagesize < sizeof(struct swap_header_v1_2) + 10) { fprintf(stderr, _("Bad user-specified page size %d\n"), user_pagesize); exit(1);