• Microsoft Windows 10 1709 • Microsoft Windows 10 1803 • Microsoft Windows 10 1809 • Microsoft Windows 10 1903 • Microsoft Windows 10 1909 • Microsoft Windows 10 2004 • Microsoft Windows Server 2019 • Microsoft Windows Server, version 1903 • Microsoft Windows Server, version 1909 • Microsoft Windows Server, version 2004
PNET_BUFFER NetBuffer, //[in], a pointer to a NetBuffer structure
ULONG BytesNeeded, //[in], the number of contiguous bytes of data requested
PVOID Storage, //[in, optional], a pointer to a buffer, orNULL ifno bufferisprovided by the caller
UINT AlignMultiple, //[in], the alignment multiple expressed inpower of two. For example, 2, 4, 8, 16, andso forth. If AlignMultiple is1, then there isno alignment requirement.
UINT AlignOffset //[in], the offset, inbytes, fromthe alignment multiple.
);
//Return Value
A pointer to the start of the contiguous data orNULL.
PVOID NdisGetDataBuffer(
PNET_BUFFER NetBuffer, //[in], a pointer to a NetBuffer structure
ULONG BytesNeeded, //[in], the number of contiguous bytes of data requested
PVOID Storage, //[in, optional], a pointer to a buffer, orNULL ifno bufferisprovided by the caller
UINT AlignMultiple, //[in], the alignment multiple expressed inpower of two. For example, 2, 4, 8, 16, andso forth. If AlignMultiple is1, then there isno alignment requirement.
UINT AlignOffset //[in], the offset, inbytes, fromthe alignment multiple.
);
//Return Value
A pointer to the start of the contiguous data orNULL.
“Ipv6pUpdateRDNSS()中发生了溢出” 感觉并非如此:YY 从协议里:“If it is desirable to have different Lifetime values, multiple RDNSS options can be used.” 可以看到、RA消息里option是可以不唯一的、我觉着是这里的问题。 作者在分析时、也说了,"回到Ipv6pHandleRouterAdvertisement()函数,再次进行数据读取时,这次读取的数据为第2个Recursive DNS Server:" 这已经不在Ipv6pUpdateRDNSS里了、怎么会是这里的问题呢,而且、关于长度的说明,lengh为4时、本来就应该是24字节、这个是对的。并非这里导致的问题。 至于第二次为啥没劲、看构造里的数据、所谓的第二个Server、其应该是第二个option、如此一来、其Type是0x18、非0x19,所以不进。
1、rfc8106里"The length of the option (including the Type and Length fields) is in units of 8 octets."可以看到length包括了这个options结构的所有字节、而且8B为一个单位、所以减去1是为了减去Type/Length/Reserved/Lifetime这些占用的空间、同时 ipv6合法地址128bit、也就是一个地址占用2个单位,减去1除以2,的确是合理的计算方式。