From: Greg Kroah-Hartman Date: Mon, 21 Dec 2020 13:21:34 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v5.10.3~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e00fb8ecf95d3961be07a86eb44101855819261;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: net-ipconfig-avoid-spurious-blank-lines-in-boot-log.patch --- diff --git a/queue-5.10/net-ipconfig-avoid-spurious-blank-lines-in-boot-log.patch b/queue-5.10/net-ipconfig-avoid-spurious-blank-lines-in-boot-log.patch new file mode 100644 index 00000000000..29b8f676e92 --- /dev/null +++ b/queue-5.10/net-ipconfig-avoid-spurious-blank-lines-in-boot-log.patch @@ -0,0 +1,78 @@ +From c9f64d1fc101c64ea2be1b2e562b4395127befc9 Mon Sep 17 00:00:00 2001 +From: Thierry Reding +Date: Tue, 10 Nov 2020 08:37:57 +0100 +Subject: net: ipconfig: Avoid spurious blank lines in boot log + +From: Thierry Reding + +commit c9f64d1fc101c64ea2be1b2e562b4395127befc9 upstream. + +When dumping the name and NTP servers advertised by DHCP, a blank line +is emitted if either of the lists is empty. This can lead to confusing +issues such as the blank line getting flagged as warning. This happens +because the blank line is the result of pr_cont("\n") and that may see +its level corrupted by some other driver concurrently writing to the +console. + +Fix this by making sure that the terminating newline is only emitted +if at least one entry in the lists was printed before. + +Reported-by: Jon Hunter +Signed-off-by: Thierry Reding +Link: https://lore.kernel.org/r/20201110073757.1284594-1-thierry.reding@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman + +--- + net/ipv4/ipconfig.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +--- a/net/ipv4/ipconfig.c ++++ b/net/ipv4/ipconfig.c +@@ -1441,7 +1441,7 @@ static int __init ip_auto_config(void) + int retries = CONF_OPEN_RETRIES; + #endif + int err; +- unsigned int i; ++ unsigned int i, count; + + /* Initialise all name servers and NTP servers to NONE (but only if the + * "ip=" or "nfsaddrs=" kernel command line parameters weren't decoded, +@@ -1575,7 +1575,7 @@ static int __init ip_auto_config(void) + if (ic_dev_mtu) + pr_cont(", mtu=%d", ic_dev_mtu); + /* Name servers (if any): */ +- for (i = 0; i < CONF_NAMESERVERS_MAX; i++) { ++ for (i = 0, count = 0; i < CONF_NAMESERVERS_MAX; i++) { + if (ic_nameservers[i] != NONE) { + if (i == 0) + pr_info(" nameserver%u=%pI4", +@@ -1583,12 +1583,14 @@ static int __init ip_auto_config(void) + else + pr_cont(", nameserver%u=%pI4", + i, &ic_nameservers[i]); ++ ++ count++; + } +- if (i + 1 == CONF_NAMESERVERS_MAX) ++ if ((i + 1 == CONF_NAMESERVERS_MAX) && count > 0) + pr_cont("\n"); + } + /* NTP servers (if any): */ +- for (i = 0; i < CONF_NTP_SERVERS_MAX; i++) { ++ for (i = 0, count = 0; i < CONF_NTP_SERVERS_MAX; i++) { + if (ic_ntp_servers[i] != NONE) { + if (i == 0) + pr_info(" ntpserver%u=%pI4", +@@ -1596,8 +1598,10 @@ static int __init ip_auto_config(void) + else + pr_cont(", ntpserver%u=%pI4", + i, &ic_ntp_servers[i]); ++ ++ count++; + } +- if (i + 1 == CONF_NTP_SERVERS_MAX) ++ if ((i + 1 == CONF_NTP_SERVERS_MAX) && count > 0) + pr_cont("\n"); + } + #endif /* !SILENT */ diff --git a/queue-5.10/series b/queue-5.10/series new file mode 100644 index 00000000000..69c5147f61a --- /dev/null +++ b/queue-5.10/series @@ -0,0 +1 @@ +net-ipconfig-avoid-spurious-blank-lines-in-boot-log.patch