[4.2.y-ckt stable] Patch "addrconf: always initialize sysctl table data" has been added to the 4.2.y-ckt tree
Kamal Mostafa
kamal at canonical.com
Fri Jan 15 23:58:04 UTC 2016
This is a note to let you know that I have just added a patch titled
addrconf: always initialize sysctl table data
to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue
This patch is scheduled to be released in version 4.2.8-ckt2.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 4.2.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
---8<------------------------------------------------------------
>From ad18e3fa953b7522fe3559aa8840655eafda5a74 Mon Sep 17 00:00:00 2001
From: WANG Cong <xiyou.wangcong at gmail.com>
Date: Mon, 21 Dec 2015 10:55:45 -0800
Subject: addrconf: always initialize sysctl table data
commit 5449a5ca9bc27dd51a462de7ca0b1cd861cd2bd0 upstream.
When sysctl performs restrict writes, it allows to write from
a middle position of a sysctl file, which requires us to initialize
the table data before calling proc_dostring() for the write case.
Fixes: 3d1bec99320d ("ipv6: introduce secret_stable to ipv6_devconf")
Reported-by: Sasha Levin <sasha.levin at oracle.com>
Acked-by: Hannes Frederic Sowa <hannes at stressinduktion.org>
Tested-by: Sasha Levin <sasha.levin at oracle.com>
Signed-off-by: Cong Wang <xiyou.wangcong at gmail.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
net/ipv6/addrconf.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index f4d78a4..d956e30 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -5269,13 +5269,10 @@ static int addrconf_sysctl_stable_secret(struct ctl_table *ctl, int write,
goto out;
}
- if (!write) {
- err = snprintf(str, sizeof(str), "%pI6",
- &secret->secret);
- if (err >= sizeof(str)) {
- err = -EIO;
- goto out;
- }
+ err = snprintf(str, sizeof(str), "%pI6", &secret->secret);
+ if (err >= sizeof(str)) {
+ err = -EIO;
+ goto out;
}
err = proc_dostring(&lctl, write, buffer, lenp, ppos);
--
1.9.1
More information about the kernel-team
mailing list