Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8766fc8 authored by Shan Wei's avatar Shan Wei Committed by YOSHIFUJI Hideaki
Browse files

ipv6: Check the hop limit setting in ancillary data.



When specifing the outgoing hop limit as ancillary data for sendmsg(),
the kernel doesn't check the integer hop limit value as specified in
[RFC-3542] section 6.3.

Signed-off-by: default avatarShan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
parent 36e3deae
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -705,6 +705,11 @@ int datagram_send_ctl(struct net *net,
			}

			*hlimit = *(int *)CMSG_DATA(cmsg);
			if (*hlimit < -1 || *hlimit > 0xff) {
				err = -EINVAL;
				goto exit_f;
			}

			break;

		case IPV6_TCLASS: