Date: Mon, 6 May 2019 08:55:23 +0000 (UTC) From: Toomas Soome <tsoome@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347182 - stable/11/stand/common Message-ID: <201905060855.x468tNDK077657@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tsoome Date: Mon May 6 08:55:23 2019 New Revision: 347182 URL: https://svnweb.freebsd.org/changeset/base/347182 Log: MFC r347142: loader: validate sectorsize argument in disk_open() The bug and patch is reported against 11.2, but it is good idea to have the check in place for all versions. PR: 236585 Submitted by: john@feith.com Reported by: john@feith.com Modified: stable/11/stand/common/disk.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/disk.c ============================================================================== --- stable/11/stand/common/disk.c Mon May 6 08:49:43 2019 (r347181) +++ stable/11/stand/common/disk.c Mon May 6 08:55:23 2019 (r347182) @@ -228,6 +228,10 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize struct ptable_entry part; int rc, slice, partition; + if (sectorsize == 0) { + DPRINTF("unknown sector size"); + return (ENXIO); + } rc = 0; od = (struct open_disk *)malloc(sizeof(struct open_disk)); if (od == NULL) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905060855.x468tNDK077657>