olistudent
IPPF-Urgestein
- Mitglied seit
- 19 Okt 2004
- Beiträge
- 14,787
- Punkte für Reaktionen
- 13
- Punkte
- 38
Ja. Nach einem make vsftpd-dirclean sollte das nächste make das Paket neu auspacken und den Patch anwenden.
Gruß,
Oliver
Gruß,
Oliver
das sieht ggf. nach mit UNIX-EOL vs. DOS-EOL Problem aus ?Code:tripping trailing CRs from patch; use --binary to disable.
file make/vsftpd/patches/121-no_libcap.patch
make/vsftpd/patches/121-no_libcap.patch: ASCII text, with CRLF line terminators
fromdos make/vsftpd/patches/121-no_libcap.patch
Ich bin mir ziemlich sicher dass ich die nicht persönlich erstellt habe.wie hast Du die Datei make/vsftpd/patches/121-no_libcap.patch
in der Freetz-VM erstellt ?
Aber ich bin mir sicher dass ich es irgendwo veranlasst habe.mit UNIX-EOL oder DOS-EOL ?
Den 900....*.patch habe ich mit Notepad++ erstellt, Windows (CR LF) und UTF-8.
Das sieht nach DOS-/WINDOWS EOL statt UNIX-EOL aus;Code:applying patch file make/vsftpd/patches/900-ignore_munmap_error.patch (Stripping trailing CRs from patch; use --binary to disable.) patching file sysutil.c (Stripping trailing CRs from patch; use --binary to disable.) patching file secbuf.c patch unexpectedly ends in middle of line patch: **** malformed patch at line 65:
Bitte mal folgende Befehl eingeben
Code:file make/vsftpd/patches/121-no_libcap.patch
freetz@Freetz-Server:~/freetz-trunk-7560$ file make/vsftpd/patches/121-no_libcap.patch
make/vsftpd/patches/121-no_libcap.patch: unified diff output, ASCII text
[Code]
Die Ausgabe die du für schädlich erachtest taucht aber beim eigentlich neuen Patch auf:
[Code]
freetz@Freetz-Server:~/freetz-trunk-7560$ file make/vsftpd/patches/900-ignore_munmap_error.patch
make/vsftpd/patches/900-ignore_munmap_error.patch: unified diff output, ASCII text, with CRLF line terminators
freetz@Freetz-Server:~/freetz-trunk-7560$ fromdos make/vsftpd/patches/900-ignore_munmap_error.patch
freetz@Freetz-Server:~/freetz-trunk-7560$ file make/vsftpd/patches/900-ignore_munmap_error.patch
make/vsftpd/patches/900-ignore_munmap_error.patch: unified diff output, ASCII text
ls -la make/vsftpd/patches/900-ignore_munmap_error.patch
cat make/vsftpd/patches/900-ignore_munmap_error.patch
freetz@Freetz-Server:~/freetz-trunk-7560$ ls -la make/vsftpd/patches/900-ignore_munmap_error.patch
-rw-r--r-- 1 freetz freetz 1556 Jan 13 18:22 make/vsftpd/patches/900-ignore_munmap_error.patch
freetz@Freetz-Server:~/freetz-trunk-7560$ cat make/vsftpd/patches/900-ignore_munmap_error.patch
--- sysutil.c
+++ sysutil.c
@@ -1152,6 +1152,12 @@
}
}
+void
+vsf_sysutil_memunmap_noerror(void* p_start, unsigned int length)
+{
+ int retval = munmap(p_start, length);
+}
+
static int
vsf_sysutil_translate_openmode(const enum EVSFSysUtilOpenMode mode)
{
--- secbuf.c
+++ secbuf.c
@@ -14,6 +14,9 @@
#include "sysutil.h"
#include "sysdeputil.h"
+void vsf_secbuf_free_noerror(char**);
+void vsf_sysutil_memunmap_noerror(void*, unsigned int);
+
void
vsf_secbuf_alloc(char** p_ptr, unsigned int size)
{
@@ -24,7 +27,7 @@
unsigned int page_size = vsf_sysutil_getpagesize();
/* Free any previous buffer */
- vsf_secbuf_free(p_ptr);
+ vsf_secbuf_free_noerror(p_ptr);
/* Round up to next page size */
page_offset = size % page_size;
if (page_offset)
@@ -87,3 +90,29 @@
vsf_sysutil_memunmap(p_mmap, map_size);
}
+void
+vsf_secbuf_free_noerror(char** p_ptr)
+{
+ if (*p_ptr == 0)
+ {
+ return;
+ }
+ unsigned int map_size;
+ unsigned long page_offset;
+ char* p_mmap = *p_ptr;
+ unsigned int page_size = vsf_sysutil_getpagesize();
+ /* Calculate the actual start of the mmap region */
+ page_offset = (unsigned long) p_mmap % page_size;
+ if (page_offset)
+ {
+ p_mmap -= page_offset;
+ }
+ p_mmap -= page_size;
+ /* First make the first page readable so we can get the size */
+ vsf_sysutil_memprotect(p_mmap, page_size, kVSFSysUtilMapProtReadOnly);
+ /* Extract the mapping size */
+ map_size = *((unsigned int*)p_mmap);
+ /* Lose the mapping */
+ vsf_sysutil_memunmap_noerror(p_mmap, map_size);
freetz@Freetz-Server:~/freetz-trunk-7560$ file make/vsftpd/patches/900-ignore_munmap_error.patch
make/vsftpd/patches/900-ignore_munmap_error.patch: unified diff output, ASCII text
Gerne.Bitte mal "./fmake -c vsftpd-precompiled" eingeben
und die Datei fmake.log als Attachement anhängen;
Code:---------------------------------------------------------------------- applying patch file make/vsftpd/patches/900-ignore_munmap_error.patch patching file sysutil.c patching file secbuf.c patch unexpectedly ends in middle of line patch: **** malformed patch at line 65: ----------------------------------------------------------------------
tail -2 make/vsftpd/patches/900-ignore_munmap_error.patch
+}
+
So läuft make zumindest mal durch.das sieht so aus, als fehlen 2 Zeilen im Patchfile in #28
Bitte prüfen/korrigieren.Code:tail -2 make/vsftpd/patches/900-ignore_munmap_error.patch +} +
....
applying patch file make/vsftpd/patches/900-ignore_munmap_error.patch
patching file sysutil.c
patching file secbuf.c
Hunk #1 succeeded at 14 with fuzz 1.
patch unexpectedly ends in middle of line
----------------------------------------------------------------------
.....
freetz@zbox:~/freetz> make vsftpd-dirclean
rm -f -r source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3
rm -f -r packages/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3; rm -f packages/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/.vsftpd packages/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/.vsftpd-3.0.3;
freetz@zbox:~/freetz> make vsftpd-source
---> package/vsftpd: preparing... mkdir -p source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3; tools/gunzip -c dl/vsftpd-3.0.3.tar.gz | tools/tar-gnu -x -C source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3 --transform='s|^./\+||' --strip-components=1
set -e; shopt -s nullglob; for i in make/vsftpd/patches/*.patch; do tools/freetz_patch source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3 $i; done;
applying patch file make/vsftpd/patches/0005-whitespaces.debian.patch
patching file parseconf.c
patching file str.c
patching file str.h
patching file sysutil.c
patching file sysutil.h
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/0006-greedy.debian.patch
patching file ls.c
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/0007-utf8.debian.patch
patching file features.c
patching file parseconf.c
patching file tunables.c
patching file tunables.h
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/0010-remote-dos.debian.patch
patching file sysdeputil.c
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/0050-CVE-2015-1419.debian.patch
patching file ls.c
patching file str.c
patching file str.h
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/100-freetz_paths.patch
patching file tunables.c
patching file defs.h
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/101-respect_freetz_largfiles_flags.patch
patching file sysutil.c
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/102-anonym_root.patch
patching file secutil.c
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/110-destdir.patch
patching file Makefile
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/111-find_libs.patch
patching file Makefile
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/120-enable_ssl.patch
patching file builddefs.h
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/121-no_libcap.patch
patching file sysdeputil.c
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/900-ignore_uninitialized_secbuf.patch
patching file sysutil.c
patching file secbuf.c
----------------------------------------------------------------------
freetz@zbox:~/freetz>
Ehe ich noch weitere Zeit investiere, hätte ich ganz gerne das Protokoll der Übersetzung des fraglichen "vsftpd" - da sollte man dann die Anwendung des Patches auch erkennen können.
Ansonsten hege ich nämlich den Verdacht, daß der einfach so (wie er oben angehangen ist) als "txt"-Datei gespeichert und daher beim Build gar nicht berücksichtigt wurde - das ist (nach dem, was ich in den Quellen gefunden habe) im Moment jedenfalls die plausibelste Vermutung.
freetz@Freetz-Server:~$ cd freetz-trunk-7560
freetz@Freetz-Server:~/freetz-trunk-7560$ make vsftpd-dirclean
rm -f -r source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0. 3
rm -f -r packages/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3. 0.3; rm -f packages/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/.vsftpd packages/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/.vsftpd-3.0.3;
freetz@Freetz-Server:~/freetz-trunk-7560$ make menuconfig
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
freetz@Freetz-Server:~/freetz-trunk-7560$ make
Dateien /home/freetz/freetz-trunk-7560/source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/.vsftpd_config.temp und /home/freetz/freetz-trunk-7560/source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/.vsftpd_config sind verschieden.
mkdir -p packages/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/root
if test -d make/vsftpd/files; then tools/tar-gnu -cf - -C make/vsftpd/files --exclude=.svn --exclude=.gitignore --exclude=.build-prereq-checked --exclude=.unpacked --exclude=.configured --exclude=.compiled --exclude=.installed . | tools/tar-gnu -xf - -C packages/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3; fi
---> package/vsftpd: preparing... mkdir -p source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3; tools/gunzip -c dl/vsftpd-3.0.3.tar.gz | tools/tar-gnu -x -C source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3 --transform='s|^./\+||' --strip-components=1
set -e; shopt -s nullglob; for i in make/vsftpd/patches/*.patch; do tools/freetz_patch source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3 $i; done;
applying patch file make/vsftpd/patches/0005-whitespaces.debian.patch
patching file parseconf.c
patching file str.c
patching file str.h
patching file sysutil.c
patching file sysutil.h
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/0006-greedy.debian.patch
patching file ls.c
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/0007-utf8.debian.patch
patching file features.c
patching file parseconf.c
patching file tunables.c
patching file tunables.h
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/0010-remote-dos.debian.patch
patching file sysdeputil.c
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/0050-CVE-2015-1419.debian.patch
patching file ls.c
patching file str.c
patching file str.h
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/100-freetz_paths.patch
patching file tunables.c
patching file defs.h
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/101-respect_freetz_largfiles_flags.patch
patching file sysutil.c
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/102-anonym_root.patch
patching file secutil.c
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/110-destdir.patch
patching file Makefile
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/111-find_libs.patch
patching file Makefile
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/120-enable_ssl.patch
patching file builddefs.h
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/121-no_libcap.patch
patching file sysdeputil.c
----------------------------------------------------------------------
applying patch file make/vsftpd/patches/900-ignore_uninitialized_secbuf.patch
patching file sysutil.c
patching file secbuf.c
----------------------------------------------------------------------
cmd() { PATH="/home/freetz/freetz-trunk-7560/toolchain/build/mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/mips-linux-uclibc/bin:/home/freetz/freetz-trunk-7560/toolchain/build/mips_gcc-5.5.0/mips-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" LD_RUN_PATH="/usr/lib/freetz" FREETZ_LIBRARY_DIR="/usr/lib/freetz" make -j2 "$@" || { printf "\n\\033[33m%s\\033[m\n" "ERROR: Build failed."; exit 1; } }; if [ -e source/.echo_item_start -a ! -e source/.echo_item_build ]; then echo -n "building... "; touch source/.echo_item_build; fi; cmd -C source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3 \
CC="/home/freetz/freetz-trunk-7560/toolchain/build/mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/mips-linux-uclibc/bin/mips-linux-uclibc-gcc" \
CFLAGS="-march=34kc -mtune=34kc -msoft-float -Os -pipe -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 " \
LDFLAGS=" -static" \
EXTRA_LIBS=""
building... make[1]: Verzeichnis „/home/freetz/freetz-trunk-7560/source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3“ wird betreten
Protokoll der Übersetzung des fraglichen "vsftpd"
Erst dann, wenn mit dem "vsftpd" ohne TLS auch eine erfolgreiche Datenübertragung (nach Login) möglich ist, macht es irgendeinen Sinn, sich dem nächsten Problem zu widmen ... es ist jedenfalls äußerst unwahrscheinlich, daß das TLS-Problem und der "munmap()"-Fehler dieselbe Ursache haben und selbst wenn das so wäre, würde man die mit dem "500 OOPS"-Problem ja auch schon beseitigen.
freetz@zbox:~/freetz> grep -n -r munmap source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/seccompsandbox.c:298: allow_nr(__NR_munmap);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/Changelog:247:- Tuning: eliminate 3 mprotect(), 1 munmap() and 1 mmap() system call per
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/Changelog:1328:- Seccomp filter sandbox: missing munmap() -- oops. Did you know that qsort()
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/sysutil.h:159:void vsf_sysutil_memunmap(void* p_start, unsigned int length);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/sysutil.c:1146:vsf_sysutil_memunmap(void* p_start, unsigned int length)
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/sysutil.c:1148: int retval = munmap(p_start, length);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/sysutil.c:1151: die("munmap"); <<< hier kommt das "500 OOPS: munmap" her
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/sysutil.c:1156:vsf_sysutil_memunmap_noerror(void* p_start, unsigned int length)
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/sysutil.c:1158: int retval = munmap(p_start, length);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.c:18:void vsf_sysutil_memunmap_noerror(void*, unsigned int);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.c:90: vsf_sysutil_memunmap(p_mmap, map_size);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.c:116: vsf_sysutil_memunmap_noerror(p_mmap, map_size);
freetz@zbox:~/freetz>
void vsf_sysutil_memunmap(void* p_start, unsigned int length)
{
int retval = munmap(p_start, length);
if (retval != 0)
{
die("munmap");
}
}
freetz@zbox:~/freetz> grep -n -r vsf_sysutil_memunmap source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/sysutil.h:159:void vsf_sysutil_memunmap(void* p_start, unsigned int length);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/sysutil.c:1146:vsf_sysutil_memunmap(void* p_start, unsigned int length)
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/sysutil.c:1156:vsf_sysutil_memunmap_noerror(void* p_start, unsigned int length)
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.c:18:void vsf_sysutil_memunmap_noerror(void*, unsigned int);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.c:90: vsf_sysutil_memunmap(p_mmap, map_size);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.c:116: vsf_sysutil_memunmap_noerror(p_mmap, map_size);
freetz@zbox:~/freetz>
void
vsf_secbuf_free(char** p_ptr)
{
unsigned int map_size;
unsigned long page_offset;
char* p_mmap = *p_ptr;
unsigned int page_size = vsf_sysutil_getpagesize();
if (p_mmap == 0)
{
return;
}
/* Calculate the actual start of the mmap region */
page_offset = (unsigned long) p_mmap % page_size;
if (page_offset)
{
p_mmap -= page_offset;
}
p_mmap -= page_size;
/* First make the first page readable so we can get the size */
vsf_sysutil_memprotect(p_mmap, page_size, kVSFSysUtilMapProtReadOnly);
/* Extract the mapping size */
map_size = *((unsigned int*)p_mmap);
/* Lose the mapping */
vsf_sysutil_memunmap(p_mmap, map_size);
}
freetz@zbox:~/freetz> grep -n -r vsf_secbuf_free source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/filestr.c:57: vsf_secbuf_free(&p_sec_buf);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.h:17:/* vsf_secbuf_free()
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.h:24:void vsf_secbuf_free(char** p_ptr);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.c:17:void vsf_secbuf_free_noerror(char**);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.c:30: vsf_secbuf_free_noerror(p_ptr);
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.c:68:vsf_secbuf_free(char** p_ptr)
source/target-mips_gcc-5.5.0_uClibc-1.0.14-nptl_kernel-3.10/vsftpd-3.0.3/secbuf.c:94:vsf_secbuf_free_noerror(char** p_ptr)
freetz@zbox:~/freetz>
/*
* Part of Very Secure FTPd
* Licence: GPL v2
* Author: Chris Evans
* filestr.c
*
* This file contains extensions to the string/buffer API, to load a file
* into a buffer.
*/
#include "filestr.h"
/* Get access to "private" functions */
#define VSFTP_STRING_HELPER
#include "str.h"
#include "sysutil.h"
#include "secbuf.h"
#include "utility.h"
int
str_fileread(struct mystr* p_str, const char* p_filename, unsigned int maxsize)
{
int fd;
int retval = 0;
filesize_t size;
char* p_sec_buf = 0;
struct vsf_sysutil_statbuf* p_stat = 0;
/* In case we fail, make sure we return an empty string */
str_empty(p_str);
fd = vsf_sysutil_open_file(p_filename, kVSFSysUtilOpenReadOnly);
if (vsf_sysutil_retval_is_error(fd))
{
return fd;
}
vsf_sysutil_fstat(fd, &p_stat);
if (vsf_sysutil_statbuf_is_regfile(p_stat))
{
size = vsf_sysutil_statbuf_get_size(p_stat);
if (size > maxsize)
{
size = maxsize;
}
vsf_secbuf_alloc(&p_sec_buf, (unsigned int) size);
retval = vsf_sysutil_read_loop(fd, p_sec_buf, (unsigned int) size);
if (vsf_sysutil_retval_is_error(retval))
{
goto free_out;
}
else if ((unsigned int) retval != size)
{
die("read size mismatch");
}
str_alloc_memchunk(p_str, p_sec_buf, (unsigned int) size);
}
free_out:
vsf_sysutil_free(p_stat);
vsf_secbuf_free(&p_sec_buf);
vsf_sysutil_close(fd);
return retval;
}
cat 901-ignore_munmap_error.patch
--- secbuf.c 2008-02-02 02:30:41.000000000 +0100
+++ secbuf.c 2019-01-14 20:00:38.265565570 +0100
@@ -51,7 +51,8 @@
*/
*((unsigned int*)p_mmap) = round_up;
p_no_access_page = p_mmap;
- vsf_sysutil_memprotect(p_no_access_page, page_size, kVSFSysUtilMapProtNone);
+ /* fix issue with MIPS SCACHE on MT7621 (and no sense to hide value of mapped block size) */
+ vsf_sysutil_memprotect(p_no_access_page, page_size, kVSFSysUtilMapProtReadOnly);
p_mmap += page_size;
if (page_offset)