diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2026-03-10 19:13:53 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2026-03-10 19:13:53 +0100 |
| commit | 3a3565140b52ca1ff87c1fa2f604089550d8efcb (patch) | |
| tree | 33d4186168de7d5c954c12d29534cc19797b5f74 /debian/patches/0105-dmidecode-avoid-sigbus.patch | |
| parent | d4b11cf3e4dcc4ca0ca41d6403c98b3214a8b92d (diff) | |
| parent | c61bb295f8ecde9a8dfb922aad56c58f1b8008e7 (diff) | |
Merge branch 'release/debian/3.7-1'HEADdebian/3.7-1master
Diffstat (limited to 'debian/patches/0105-dmidecode-avoid-sigbus.patch')
| -rw-r--r-- | debian/patches/0105-dmidecode-avoid-sigbus.patch | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/debian/patches/0105-dmidecode-avoid-sigbus.patch b/debian/patches/0105-dmidecode-avoid-sigbus.patch deleted file mode 100644 index 518d972..0000000 --- a/debian/patches/0105-dmidecode-avoid-sigbus.patch +++ /dev/null @@ -1,50 +0,0 @@ -Description: Avoid SIGBUS on mmap failure - mmap will fail with SIGBUS if trying to map a non-existent portion of - a file. While this should never happen with /dev/mem, it can happen if - passing a regular file with option -d. While people should no longer - do that, failure gracefully seems better than crashing. So check for - the file size before calling mmap. -Author: Jean Delvare <jdelvare@suse.de> -Origin: https://savannah.nongnu.org/bugs/download.php?file_id=35008 -Bug: https://savannah.nongnu.org/bugs/index.php?46066 -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=796963 -Last-Update: 2015-10-01 ----- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- dmidecode.orig/util.c 2015-09-29 11:27:02.136566009 +0200 -+++ dmidecode/util.c 2015-09-29 11:37:24.746191083 +0200 -@@ -152,6 +152,7 @@ void *mem_chunk(off_t base, size_t len, - void *p; - int fd; - #ifdef USE_MMAP -+ struct stat statbuf; - off_t mmoffset; - void *mmp; - #endif -@@ -169,6 +170,26 @@ void *mem_chunk(off_t base, size_t len, - } - - #ifdef USE_MMAP -+ if (fstat(fd, &statbuf) == -1) -+ { -+ fprintf(stderr, "%s: ", devmem); -+ perror("stat"); -+ free(p); -+ return NULL; -+ } -+ -+ /* -+ * mmap() will fail with SIGBUS if trying to map beyond the end of -+ * the file. -+ */ -+ if (S_ISREG(statbuf.st_mode) && base + (off_t)len > statbuf.st_size) -+ { -+ fprintf(stderr, "mmap: Can't map beyond end of file %s\n", -+ devmem); -+ free(p); -+ return NULL; -+ } -+ - #ifdef _SC_PAGESIZE - mmoffset = base % sysconf(_SC_PAGESIZE); - #else |
