diff options
author | Greg Kroah-Hartman <gregkh@google.com> | 2020-05-05 19:29:21 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2020-05-05 19:29:21 +0200 |
commit | b7e5163e48fbcc262d65782d3fabd1cc08a2d757 (patch) | |
tree | 74be41e9042e434b9e4a36620d93b29ac4313a16 /net/ipv6/raw.c | |
parent | 82cb57eb0b7280471835e36813b94cd4f2a37372 (diff) | |
parent | b63f449e18b130fdc372b9717e72c19b83fc4876 (diff) |
Merge 4.4.222 into android-4.4-p
Changes in 4.4.222
ext4: fix special inode number checks in __ext4_iget()
drm/qxl: qxl_release leak in qxl_hw_surface_alloc()
ALSA: pcm: oss: Place the plugin buffer overflow checks correctly
PM: ACPI: Output correct message on target power state
RDMA/mlx4: Initialize ib_spec on the stack
vfio/type1: Fix VA->PA translation for PFNMAP VMAs in vaddr_get_pfn()
ALSA: opti9xx: shut up gcc-10 range warning
nfs: Fix potential posix_acl refcnt leak in nfs3_set_acl
dmaengine: dmatest: Fix iteration non-stop logic
i2c: designware-pci: use IRQF_COND_SUSPEND flag
perf hists: Fix HISTC_MEM_DCACHELINE width setting
powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8
perf/x86: Fix uninitialized value usage
exynos4-is: fix a format string bug
ASoC: wm8960: Fix WM8960_SYSCLK_PLL mode
ASoC: imx-spdif: Fix crash on suspend
ipv6: use READ_ONCE() for inet->hdrincl as in ipv4
selinux: properly handle multiple messages in selinux_netlink_send()
Linux 4.4.222
Change-Id: I510144039d424ae2e57ae23c188f2ed4d020ed11
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'net/ipv6/raw.c')
-rw-r--r-- | net/ipv6/raw.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 30db0167bd19..1a940af30300 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -757,6 +757,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) int hlimit = -1; int tclass = -1; int dontfrag = -1; + int hdrincl; u16 proto; int err; @@ -770,6 +771,13 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) if (msg->msg_flags & MSG_OOB) return -EOPNOTSUPP; + /* hdrincl should be READ_ONCE(inet->hdrincl) + * but READ_ONCE() doesn't work with bit fields. + * Doing this indirectly yields the same result. + */ + hdrincl = inet->hdrincl; + hdrincl = READ_ONCE(hdrincl); + /* * Get and verify the address. */ @@ -879,7 +887,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) fl6.flowi6_oif = np->ucast_oif; security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); - if (inet->hdrincl) + if (hdrincl) fl6.flowi6_flags |= FLOWI_FLAG_KNOWN_NH; dst = ip6_dst_lookup_flow(sk, &fl6, final_p); @@ -900,7 +908,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) goto do_confirm; back_from_confirm: - if (inet->hdrincl) + if (hdrincl) err = rawv6_send_hdrinc(sk, msg, len, &fl6, &dst, msg->msg_flags); else { lock_sock(sk); |