summaryrefslogtreecommitdiff
path: root/net/ipv4/sysctl_net_ipv4.c
diff options
context:
space:
mode:
authorSrinivasarao P <spathi@codeaurora.org>2018-08-02 10:15:59 +0530
committerSrinivasarao P <spathi@codeaurora.org>2018-08-03 17:00:19 +0530
commit508ac0adfc5bc7a0ec3fc81e2ac9371e3add6d6c (patch)
tree1ff64472e3ecd2adb607e31cb2cf27d8566a9051 /net/ipv4/sysctl_net_ipv4.c
parentc2e09fadec5ce348e125150e66a9a32b4af44756 (diff)
parent7bbfac190345ca532ea790c9d9ccb15682d7b99b (diff)
Merge android-4.4.143 (7bbfac1) into msm-4.4
* refs/heads/tmp-7bbfac1 Linux 4.4.143 net/nfc: Avoid stalls when nfc_alloc_send_skb() returned NULL. rds: avoid unenecessary cong_update in loop transport KEYS: DNS: fix parsing multiple options netfilter: ebtables: reject non-bridge targets MIPS: Use async IPIs for arch_trigger_cpumask_backtrace() MIPS: Call dump_stack() from show_regs() rtlwifi: rtl8821ae: fix firmware is not ready to run net: cxgb3_main: fix potential Spectre v1 net/mlx5: Fix command interface race in polling mode net_sched: blackhole: tell upper qdisc about dropped packets vhost_net: validate sock before trying to put its fd tcp: prevent bogus FRTO undos with non-SACK flows tcp: fix Fast Open key endianness r8152: napi hangup fix after disconnect qed: Limit msix vectors in kdump kernel to the minimum required count. net: sungem: fix rx checksum support net/mlx5: Fix incorrect raw command length parsing net: dccp: switch rx_tstamp_last_feedback to monotonic clock net: dccp: avoid crash in ccid3_hc_rx_send_feedback() atm: zatm: Fix potential Spectre v1 crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak crypto: crypto4xx - remove bad list_del bcm63xx_enet: do not write to random DMA channel on BCM6345 bcm63xx_enet: correct clock usage ocfs2: subsystem.su_mutex is required while accessing the item->ci_parent Revert "sit: reload iphdr in ipip6_rcv" x86/asm: Add _ASM_ARG* constants for argument registers to <asm/asm.h> compiler-gcc.h: Add __attribute__((gnu_inline)) to all inline declarations compiler, clang: always inline when CONFIG_OPTIMIZE_INLINING is disabled compiler, clang: properly override 'inline' for clang compiler, clang: suppress warning for unused static inline functions Change-Id: Ia4be0ff93c81aee090c38127014680460e8cc756 Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org> Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Diffstat (limited to 'net/ipv4/sysctl_net_ipv4.c')
-rw-r--r--net/ipv4/sysctl_net_ipv4.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 8233e27679f2..4d3594395b21 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -232,8 +232,9 @@ static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write,
{
struct ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) };
struct tcp_fastopen_context *ctxt;
- int ret;
u32 user_key[4]; /* 16 bytes, matching TCP_FASTOPEN_KEY_LENGTH */
+ __le32 key[4];
+ int ret, i;
tbl.data = kmalloc(tbl.maxlen, GFP_KERNEL);
if (!tbl.data)
@@ -242,11 +243,14 @@ static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write,
rcu_read_lock();
ctxt = rcu_dereference(tcp_fastopen_ctx);
if (ctxt)
- memcpy(user_key, ctxt->key, TCP_FASTOPEN_KEY_LENGTH);
+ memcpy(key, ctxt->key, TCP_FASTOPEN_KEY_LENGTH);
else
- memset(user_key, 0, sizeof(user_key));
+ memset(key, 0, sizeof(key));
rcu_read_unlock();
+ for (i = 0; i < ARRAY_SIZE(key); i++)
+ user_key[i] = le32_to_cpu(key[i]);
+
snprintf(tbl.data, tbl.maxlen, "%08x-%08x-%08x-%08x",
user_key[0], user_key[1], user_key[2], user_key[3]);
ret = proc_dostring(&tbl, write, buffer, lenp, ppos);
@@ -262,12 +266,16 @@ static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write,
* first invocation of tcp_fastopen_cookie_gen
*/
tcp_fastopen_init_key_once(false);
- tcp_fastopen_reset_cipher(user_key, TCP_FASTOPEN_KEY_LENGTH);
+
+ for (i = 0; i < ARRAY_SIZE(user_key); i++)
+ key[i] = cpu_to_le32(user_key[i]);
+
+ tcp_fastopen_reset_cipher(key, TCP_FASTOPEN_KEY_LENGTH);
}
bad_key:
pr_debug("proc FO key set 0x%x-%x-%x-%x <- 0x%s: %u\n",
- user_key[0], user_key[1], user_key[2], user_key[3],
+ user_key[0], user_key[1], user_key[2], user_key[3],
(char *)tbl.data, ret);
kfree(tbl.data);
return ret;