mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-24 09:52:58 +02:00
Merge remote-tracking branch 'arne_f/gcc-7-retpol' into kernel-4.14
This commit is contained in:
@@ -32,14 +32,14 @@
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char buffer[STRING_SIZE], command[STRING_SIZE], hostname[STRING_SIZE];
|
||||
const char* protocol;
|
||||
char buffer[STRING_SIZE], command[STRING_SIZE], hostname[STRING_SIZE], protocol[STRING_SIZE];
|
||||
char varmessages[STRING_SIZE], asynclog[STRING_SIZE];
|
||||
int config_fd,rc,fd,pid;
|
||||
struct stat st;
|
||||
struct keyvalue *kv = NULL;
|
||||
memset(buffer, 0, STRING_SIZE);
|
||||
memset(hostname, 0, STRING_SIZE);
|
||||
memset(protocol, 0, STRING_SIZE);
|
||||
memset(varmessages, 0, STRING_SIZE);
|
||||
memset(asynclog, 0, STRING_SIZE);
|
||||
|
||||
@@ -71,7 +71,7 @@ int main(void)
|
||||
if (!findkey(kv, "REMOTELOG_PROTOCOL", protocol))
|
||||
{
|
||||
/* fall back to UDP if no protocol was given */
|
||||
protocol = "udp";
|
||||
strcpy(protocol, "udp");
|
||||
}
|
||||
|
||||
if (strspn(hostname, VALID_FQDN) != strlen(hostname))
|
||||
|
||||
@@ -60,7 +60,7 @@ depmod -a $KVER-ipfire-pae
|
||||
#
|
||||
# Made initramdisk
|
||||
#
|
||||
/usr/bin/dracut --early-microcode --force --xz /boot/initramfs-$KVER-ipfire-pae.img $KVER-ipfire-pae
|
||||
/usr/bin/dracut --force --xz /boot/initramfs-$KVER-ipfire-pae.img $KVER-ipfire-pae
|
||||
|
||||
if [ -e /boot/grub/grub.cfg ]; then
|
||||
#
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
diff --git a/dmiopt.c b/dmiopt.c
|
||||
index 0d142d2..de607f4 100644
|
||||
--- a/dmiopt.c
|
||||
+++ b/dmiopt.c
|
||||
@@ -314,6 +314,7 @@ void print_help(void)
|
||||
" -u, --dump Do not decode the entries\n"
|
||||
" --dump-bin FILE Dump the DMI data to a binary file\n"
|
||||
" --from-dump FILE Read the DMI data from a binary file\n"
|
||||
+ " --no-sysfs Do not attempt to read DMI data from sysfs files\n"
|
||||
" -V, --version Display the version and exit\n";
|
||||
|
||||
printf("%s", help);
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
diff --git a/dmidecode.c b/dmidecode.c
|
||||
index ce0511b..cfcade4 100644
|
||||
--- a/dmidecode.c
|
||||
+++ b/dmidecode.c
|
||||
@@ -4866,8 +4866,16 @@ int main(int argc, char * const argv[])
|
||||
goto exit_free;
|
||||
}
|
||||
|
||||
- if (smbios_decode(buf, opt.devmem, 0))
|
||||
- found++;
|
||||
+ if (memcmp(buf, "_SM3_", 5) == 0)
|
||||
+ {
|
||||
+ if (smbios3_decode(buf, opt.devmem, 0))
|
||||
+ found++;
|
||||
+ }
|
||||
+ else if (memcmp(buf, "_SM_", 4) == 0)
|
||||
+ {
|
||||
+ if (smbios_decode(buf, opt.devmem, 0))
|
||||
+ found++;
|
||||
+ }
|
||||
goto done;
|
||||
|
||||
memory_scan:
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
diff --git a/dmidecode.c b/dmidecode.c
|
||||
index 183ced4..a43cfd1 100644
|
||||
--- a/dmidecode.c
|
||||
+++ b/dmidecode.c
|
||||
@@ -4751,6 +4751,7 @@ int main(int argc, char * const argv[])
|
||||
int ret = 0; /* Returned value */
|
||||
int found = 0;
|
||||
off_t fp;
|
||||
+ size_t size;
|
||||
int efi;
|
||||
u8 *buf;
|
||||
|
||||
@@ -4820,8 +4821,9 @@ int main(int argc, char * const argv[])
|
||||
* contain one of several types of entry points, so read enough for
|
||||
* the largest one, then determine what type it contains.
|
||||
*/
|
||||
+ size = 0x20;
|
||||
if (!(opt.flags & FLAG_NO_SYSFS)
|
||||
- && (buf = read_file(0x20, SYS_ENTRY_FILE)) != NULL)
|
||||
+ && (buf = read_file(&size, SYS_ENTRY_FILE)) != NULL)
|
||||
{
|
||||
if (!(opt.flags & FLAG_QUIET))
|
||||
printf("Getting SMBIOS data from sysfs.\n");
|
||||
diff --git a/util.c b/util.c
|
||||
index f97ac0d..52ed413 100644
|
||||
--- a/util.c
|
||||
+++ b/util.c
|
||||
@@ -94,10 +94,11 @@ int checksum(const u8 *buf, size_t len)
|
||||
* needs to be freed by the caller.
|
||||
* This provides a similar usage model to mem_chunk()
|
||||
*
|
||||
- * Returns pointer to buffer of max_len bytes, or NULL on error
|
||||
+ * Returns pointer to buffer of max_len bytes, or NULL on error, and
|
||||
+ * sets max_len to the length actually read.
|
||||
*
|
||||
*/
|
||||
-void *read_file(size_t max_len, const char *filename)
|
||||
+void *read_file(size_t *max_len, const char *filename)
|
||||
{
|
||||
int fd;
|
||||
size_t r2 = 0;
|
||||
@@ -115,7 +116,7 @@ void *read_file(size_t max_len, const char *filename)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
- if ((p = malloc(max_len)) == NULL)
|
||||
+ if ((p = malloc(*max_len)) == NULL)
|
||||
{
|
||||
perror("malloc");
|
||||
return NULL;
|
||||
@@ -123,7 +124,7 @@ void *read_file(size_t max_len, const char *filename)
|
||||
|
||||
do
|
||||
{
|
||||
- r = read(fd, p + r2, max_len - r2);
|
||||
+ r = read(fd, p + r2, *max_len - r2);
|
||||
if (r == -1)
|
||||
{
|
||||
if (errno != EINTR)
|
||||
@@ -140,6 +141,8 @@ void *read_file(size_t max_len, const char *filename)
|
||||
while (r != 0);
|
||||
|
||||
close(fd);
|
||||
+ *max_len = r2;
|
||||
+
|
||||
return p;
|
||||
}
|
||||
|
||||
diff --git a/util.h b/util.h
|
||||
index 9d409cd..b8748f1 100644
|
||||
--- a/util.h
|
||||
+++ b/util.h
|
||||
@@ -25,7 +25,7 @@
|
||||
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
|
||||
|
||||
int checksum(const u8 *buf, size_t len);
|
||||
-void *read_file(size_t len, const char *filename);
|
||||
+void *read_file(size_t *len, const char *filename);
|
||||
void *mem_chunk(off_t base, size_t len, const char *devmem);
|
||||
int write_dump(size_t base, size_t len, const void *data, const char *dumpfile, int add);
|
||||
u64 u64_range(u64 start, u64 end);
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
From 364055211b1956539c6a6268e111e244e1292c8c Mon Sep 17 00:00:00 2001
|
||||
From: Jean Delvare <jdelvare@suse.de>
|
||||
Date: Mon, 2 Nov 2015 09:45:31 +0100
|
||||
Subject: [PATCH] dmidecode: Use read_file() to read the DMI table from sysfs
|
||||
|
||||
We shouldn't use mem_chunk() to read the DMI table from sysfs. This
|
||||
will fail for SMBIOS v3 implementations which specify a maximum length
|
||||
for the table rather than its exact length. The kernel will trim the
|
||||
table to the actual length, so the DMI file will be shorter than the
|
||||
length announced in entry point.
|
||||
|
||||
read_file() fits the bill in this case, as it deals with end of file
|
||||
nicely.
|
||||
|
||||
This also helps with corrupted DMI tables, as the kernel will not
|
||||
export the part of the table that it wasn't able to parse, effectively
|
||||
trimming it.
|
||||
|
||||
This fixes bug #46176:
|
||||
https://savannah.nongnu.org/bugs/?46176
|
||||
Unexpected end of file error
|
||||
---
|
||||
CHANGELOG | 3 +++
|
||||
dmidecode.c | 29 +++++++++++++++++++++--------
|
||||
2 files changed, 24 insertions(+), 8 deletions(-)
|
||||
|
||||
|
||||
diff --git a/dmidecode.c b/dmidecode.c
|
||||
index a43cfd1..16d1823 100644
|
||||
--- a/dmidecode.c
|
||||
+++ b/dmidecode.c
|
||||
@@ -4524,16 +4524,29 @@ static void dmi_table(off_t base, u32 len, u16 num, u16 ver, const char *devmem,
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
- /*
|
||||
- * When we are reading the DMI table from sysfs, we want to print
|
||||
- * the address of the table (done above), but the offset of the
|
||||
- * data in the file is 0. When reading from /dev/mem, the offset
|
||||
- * in the file is the address.
|
||||
- */
|
||||
if (flags & FLAG_NO_FILE_OFFSET)
|
||||
- base = 0;
|
||||
+ {
|
||||
+ /*
|
||||
+ * When reading from sysfs, the file may be shorter than
|
||||
+ * announced. For SMBIOS v3 this is expcted, as we only know
|
||||
+ * the maximum table size, not the actual table size. For older
|
||||
+ * implementations (and for SMBIOS v3 too), this would be the
|
||||
+ * result of the kernel truncating the table on parse error.
|
||||
+ */
|
||||
+ size_t size = len;
|
||||
+ buf = read_file(&size, devmem);
|
||||
+ if (!(opt.flags & FLAG_QUIET) && num && size != (size_t)len)
|
||||
+ {
|
||||
+ printf("Wrong DMI structures length: %u bytes "
|
||||
+ "announced, only %lu bytes available.\n",
|
||||
+ len, (unsigned long)size);
|
||||
+ }
|
||||
+ len = size;
|
||||
+ }
|
||||
+ else
|
||||
+ buf = mem_chunk(base, len, devmem);
|
||||
|
||||
- if ((buf = mem_chunk(base, len, devmem)) == NULL)
|
||||
+ if (buf == NULL)
|
||||
{
|
||||
fprintf(stderr, "Table is unreachable, sorry."
|
||||
#ifndef USE_MMAP
|
||||
--
|
||||
2.1.4
|
||||
|
||||
23
src/patches/glibc/glibc-2.25-gcc-7.patch
Normal file
23
src/patches/glibc/glibc-2.25-gcc-7.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
diff --git a/malloc/hooks.c b/malloc/hooks.c
|
||||
index 4398c0a017..2c6cebc889 100644
|
||||
--- a/malloc/hooks.c
|
||||
+++ b/malloc/hooks.c
|
||||
@@ -347,11 +347,18 @@ realloc_check (void *oldmem, size_t bytes, const void *caller)
|
||||
newmem = _int_realloc (&main_arena, oldp, oldsize, nb);
|
||||
}
|
||||
|
||||
+ DIAG_PUSH_NEEDS_COMMENT;
|
||||
+#if __GNUC_PREREQ (7, 0)
|
||||
+ /* GCC 7 warns about magic_p may be used uninitialized. But we never
|
||||
+ reach here if magic_p is uninitialized. */
|
||||
+ DIAG_IGNORE_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
|
||||
+#endif
|
||||
/* mem2chunk_check changed the magic byte in the old chunk.
|
||||
If newmem is NULL, then the old chunk will still be used though,
|
||||
so we need to invert that change here. */
|
||||
if (newmem == NULL)
|
||||
*magic_p ^= 0xFF;
|
||||
+ DIAG_POP_NEEDS_COMMENT;
|
||||
|
||||
__libc_lock_unlock (main_arena.mutex);
|
||||
|
||||
36
src/patches/lz4-1.8.1.2_mod_install_path.patch
Normal file
36
src/patches/lz4-1.8.1.2_mod_install_path.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
diff -Nur lz4-1.8.1.2.orig/lib/Makefile lz4-1.8.1.2/lib/Makefile
|
||||
--- lz4-1.8.1.2.orig/lib/Makefile 2018-01-21 07:24:41.881357925 +0000
|
||||
+++ lz4-1.8.1.2/lib/Makefile 2018-01-21 07:25:44.823444081 +0000
|
||||
@@ -120,7 +120,7 @@
|
||||
# directory variables : GNU conventions prefer lowercase
|
||||
# see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
|
||||
# support both lower and uppercase (BSD), use uppercase in script
|
||||
-prefix ?= /usr/local
|
||||
+prefix ?= /usr
|
||||
PREFIX ?= $(prefix)
|
||||
exec_prefix ?= $(PREFIX)
|
||||
libdir ?= $(exec_prefix)/lib
|
||||
diff -Nur lz4-1.8.1.2.orig/NEWS lz4-1.8.1.2/NEWS
|
||||
--- lz4-1.8.1.2.orig/NEWS 2018-01-21 07:24:41.809360114 +0000
|
||||
+++ lz4-1.8.1.2/NEWS 2018-01-21 07:26:00.838957106 +0000
|
||||
@@ -96,7 +96,7 @@
|
||||
New : lz4 cli supports long commands (suggested by Takayuki Matsuoka)
|
||||
New : lz4frame & lz4cli frame content size support
|
||||
New : lz4frame supports skippable frames, as requested by Sergey Cherepanov
|
||||
-Changed: Default "make install" directory is /usr/local, as notified by Ron Johnson
|
||||
+Changed: Default "make install" directory is /usr, as notified by Ron Johnson
|
||||
New : lz4 cli supports "pass-through" mode, requested by Neil Wilson
|
||||
New : datagen can generate sparse files
|
||||
New : scan-build tests, thanks to kind help by Takayuki Matsuoka
|
||||
diff -Nur lz4-1.8.1.2.orig/programs/Makefile lz4-1.8.1.2/programs/Makefile
|
||||
--- lz4-1.8.1.2.orig/programs/Makefile 2018-01-21 07:24:41.881357925 +0000
|
||||
+++ lz4-1.8.1.2/programs/Makefile 2018-01-21 07:26:24.562235766 +0000
|
||||
@@ -121,7 +121,7 @@
|
||||
# directory variables : GNU conventions prefer lowercase
|
||||
# see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
|
||||
# support both lower and uppercase (BSD), use uppercase in script
|
||||
-prefix ?= /usr/local
|
||||
+prefix ?= /usr
|
||||
PREFIX ?= $(prefix)
|
||||
exec_prefix ?= $(PREFIX)
|
||||
bindir ?= $(exec_prefix)/bin
|
||||
12
src/patches/mdadm/gcc-7.patch
Normal file
12
src/patches/mdadm/gcc-7.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -Naur mdadm-4.0.org/Makefile mdadm-4.0/Makefile
|
||||
--- mdadm-4.0.org/Makefile 2017-01-09 22:46:34.000000000 +0100
|
||||
+++ mdadm-4.0/Makefile 2018-01-19 11:18:42.868219725 +0100
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
CC ?= $(CROSS_COMPILE)gcc
|
||||
CXFLAGS ?= -ggdb
|
||||
-CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
|
||||
+CWFLAGS = -Wall -Werror -Werror=implicit-fallthrough=0 -Werror=format-overflow=0 -Werror=format-truncation=0 -Wstrict-prototypes -Wextra -Wno-unused-parameter
|
||||
ifdef WARN_UNUSED
|
||||
CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
|
||||
endif
|
||||
39
src/patches/sarg/sarg-2.3.11-format.patch
Normal file
39
src/patches/sarg/sarg-2.3.11-format.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
diff -Naur sarg-2.3.11.org/index.c sarg-2.3.11/index.c
|
||||
--- sarg-2.3.11.org/index.c 2018-01-14 19:00:22.000000000 +0100
|
||||
+++ sarg-2.3.11/index.c 2018-01-24 14:38:19.746338020 +0100
|
||||
@@ -89,9 +89,9 @@
|
||||
char monthdir[MAXLEN];
|
||||
char monthname1[9], monthname2[9];
|
||||
char nmonth[30];
|
||||
- char monthnum[10];
|
||||
+ char monthnum[15];
|
||||
char dayindex[MAXLEN];
|
||||
- char daynum[10];
|
||||
+ char daynum[15];
|
||||
char title[80];
|
||||
int yearsort[150];
|
||||
int nyears;
|
||||
diff -Naur sarg-2.3.11.org/report.c sarg-2.3.11/report.c
|
||||
--- sarg-2.3.11.org/report.c 2018-01-14 19:00:23.000000000 +0100
|
||||
+++ sarg-2.3.11/report.c 2018-01-24 14:38:19.742337939 +0100
|
||||
@@ -54,7 +54,7 @@
|
||||
char accsmart[MAXLEN];
|
||||
char crc2[MAXLEN/2 -1];
|
||||
char siteind[MAX_TRUNCATED_URL];
|
||||
- char arqtt[256];
|
||||
+ char arqtt[MAX_USER_FNAME_LEN * 2 + MAXLEN + 10];
|
||||
char *oldurltt=NULL;
|
||||
char oldaccdiatt[11],oldacchoratt[9];
|
||||
char tmp3[MAXLEN];
|
||||
diff -Naur sarg-2.3.11.org/userinfo.c sarg-2.3.11/userinfo.c
|
||||
--- sarg-2.3.11.org/userinfo.c 2013-06-01 20:02:04.000000000 +0200
|
||||
+++ sarg-2.3.11/userinfo.c 2018-01-24 14:38:19.746338020 +0100
|
||||
@@ -67,7 +67,7 @@
|
||||
int skip;
|
||||
int flen;
|
||||
int count, clen;
|
||||
- char cstr[9];
|
||||
+ char cstr[10];
|
||||
|
||||
last=NULL;
|
||||
for (group=first_user_group ; group ; group=group->next) {
|
||||
28
src/patches/squid/SQUID-2018_1.patch
Normal file
28
src/patches/squid/SQUID-2018_1.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
commit eb2db98a676321b814fc4a51c4fb7928a8bb45d9 (refs/remotes/origin/v3.5)
|
||||
Author: Amos Jeffries <yadij@users.noreply.github.com>
|
||||
Date: 2018-01-19 13:54:14 +1300
|
||||
|
||||
ESI: make sure endofName never exceeds tagEnd (#130)
|
||||
|
||||
diff --git a/src/esi/CustomParser.cc b/src/esi/CustomParser.cc
|
||||
index d86d2d3..db634d9 100644
|
||||
--- a/src/esi/CustomParser.cc
|
||||
+++ b/src/esi/CustomParser.cc
|
||||
@@ -121,7 +121,7 @@ ESICustomParser::parse(char const *dataToParse, size_t const lengthOfData, bool
|
||||
|
||||
char * endofName = strpbrk(const_cast<char *>(tag), w_space);
|
||||
|
||||
- if (endofName > tagEnd)
|
||||
+ if (!endofName || endofName > tagEnd)
|
||||
endofName = const_cast<char *>(tagEnd);
|
||||
|
||||
*endofName = '\0';
|
||||
@@ -214,7 +214,7 @@ ESICustomParser::parse(char const *dataToParse, size_t const lengthOfData, bool
|
||||
|
||||
char * endofName = strpbrk(const_cast<char *>(tag), w_space);
|
||||
|
||||
- if (endofName > tagEnd)
|
||||
+ if (!endofName || endofName > tagEnd)
|
||||
endofName = const_cast<char *>(tagEnd);
|
||||
|
||||
*endofName = '\0';
|
||||
23
src/patches/squid/SQUID-2018_2.patch
Normal file
23
src/patches/squid/SQUID-2018_2.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
commit 8232b83d3fa47a1399f155cb829db829369fbae9 (refs/remotes/origin/v3.5)
|
||||
Author: squidadm <squidadm@users.noreply.github.com>
|
||||
Date: 2018-01-21 08:07:08 +1300
|
||||
|
||||
Fix indirect IP logging for transactions without a client connection (#129) (#136)
|
||||
|
||||
diff --git a/src/client_side_request.cc b/src/client_side_request.cc
|
||||
index be124f3..203f89d 100644
|
||||
--- a/src/client_side_request.cc
|
||||
+++ b/src/client_side_request.cc
|
||||
@@ -488,9 +488,9 @@ clientFollowXForwardedForCheck(allow_t answer, void *data)
|
||||
* Ensure that the access log shows the indirect client
|
||||
* instead of the direct client.
|
||||
*/
|
||||
- ConnStateData *conn = http->getConn();
|
||||
- conn->log_addr = request->indirect_client_addr;
|
||||
- http->al->cache.caddr = conn->log_addr;
|
||||
+ http->al->cache.caddr = request->indirect_client_addr;
|
||||
+ if (ConnStateData *conn = http->getConn())
|
||||
+ conn->log_addr = request->indirect_client_addr;
|
||||
}
|
||||
request->x_forwarded_for_iterator.clean();
|
||||
request->flags.done_follow_x_forwarded_for = true;
|
||||
@@ -24,4 +24,4 @@
|
||||
#
|
||||
KVER=`uname -r | cut -d"-" -f1`
|
||||
|
||||
dracut --early-microcode --force --verbose /boot/ipfirerd-$KVER.img $KVER-ipfire
|
||||
dracut --force --verbose /boot/ipfirerd-$KVER.img $KVER-ipfire
|
||||
|
||||
Reference in New Issue
Block a user