Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix buggy code related to CONFIG_FORTIFY_SOURCE Kernel versions >4.12 #2

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DPO_RT5572_LinuxSTA_2.6.1.3_20121022/common/cmm_mac_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@


#ifdef RTMP_MAC_USB

#define usb_buffer_alloc(a, b, c, d) usb_alloc_coherent(a, b, c, d)
#define usb_buffer_free(a, b, c, d) usb_free_coherent(a, b, c, d)

#include "rt_config.h"

Expand Down
10 changes: 5 additions & 5 deletions DPO_RT5572_LinuxSTA_2.6.1.3_20121022/common/cmm_wpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1816,17 +1816,17 @@ int RtmpPasswordHash(PSTRING password, PUCHAR ssid, INT ssidlength, PUCHAR outpu
Return Value:

Note:
Output �� KDF-Length (K, label, Context) where
Output ¡ö KDF-Length (K, label, Context) where
Input: K, a 256-bit key derivation key
label, a string identifying the purpose of the keys derived using this KDF
Context, a bit string that provides context to identify the derived key
Length, the length of the derived key in bits
Output: a Length-bit derived key

result �� ""
iterations �� (Length+255)/256
result ¡ö ""
iterations ¡ö (Length+255)/256
do i = 1 to iterations
result �� result || HMAC-SHA256(K, i || label || Context || Length)
result ¡ö result || HMAC-SHA256(K, i || label || Context || Length)
od
return first Length bits of result, and securely delete all unused bits

Expand Down Expand Up @@ -2493,7 +2493,7 @@ VOID RTMPMakeRSNIE(
UCHAR PrimaryRsnie;
BOOLEAN bMixCipher = FALSE; /* indicate the pairwise and group cipher are different*/
UCHAR p_offset;
WPA_MIX_PAIR_CIPHER FlexibleCipher = MIX_CIPHER_NOTUSE; /* it provide the more flexible cipher combination in WPA-WPA2 and TKIPAES mode*/
WPA_MIX_PAIR_CIPHER FlexibleCipher = WPA_TKIPAES_WPA2_TKIPAES; /* it provide the more flexible cipher combination in WPA-WPA2 and TKIPAES mode*/

rsnielen_cur_p = NULL;
rsnielen_ex_cur_p = NULL;
Expand Down
4 changes: 2 additions & 2 deletions DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ HAS_APCLI=n

# Support Wpa_Supplicant
# i.e. wpa_supplicant -Dralink
HAS_WPA_SUPPLICANT=n
HAS_WPA_SUPPLICANT=y


# Support Native WpaSupplicant for Network Maganger
Expand All @@ -32,7 +32,7 @@ HAS_WPA_SUPPLICANT=n
# what if user want to use wpa_supplicant to serve P2P function/feature,
# in case, it must use Ralink Propriectary wpa_supplicant to do.
# and this compile flag will report P2P Related Event to Ralink wpa_supplicant.
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

#Support Net interface block while Tx-Sw queue full
HAS_BLOCK_NET_IF=n
Expand Down
8 changes: 6 additions & 2 deletions DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/rt_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,9 @@ PNDIS_PACKET duplicate_pkt(
MEM_DBG_PKT_ALLOC_INC(skb);

skb_reserve(skb, 2);
NdisMoveMemory(skb->tail, pHeader802_3, HdrLen);
NdisMoveMemory(skb_tail_pointer(skb), pHeader802_3, HdrLen);
skb_put(skb, HdrLen);
NdisMoveMemory(skb->tail, pData, DataSize);
NdisMoveMemory(skb_tail_pointer(skb), pData, DataSize);
skb_put(skb, DataSize);
skb->dev = pNetDev; /*get_netdev_from_bssid(pAd, FromWhichBSSID); */
pPacket = OSPKT_TO_RTPKT(skb);
Expand Down Expand Up @@ -1110,6 +1110,8 @@ void RtmpOSFileSeek(RTMP_OS_FD osfd,

int RtmpOSFileRead(RTMP_OS_FD osfd,
char *pDataPtr, int readLen) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
return = kernel_read(osfd, pDataPtr, readLen, &osfd->f_pos);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
return vfs_read(osfd, pDataPtr, readLen, &osfd->f_pos);
#else
Expand All @@ -1125,6 +1127,8 @@ int RtmpOSFileRead(RTMP_OS_FD osfd,

int RtmpOSFileWrite(RTMP_OS_FD osfd,
char *pDataPtr, int writeLen) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
return kernel_write(osfd, pDataPtr, writeLen, &osfd->f_pos);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
return vfs_write(osfd, pDataPtr, writeLen, &osfd->f_pos);
#else
Expand Down
2 changes: 1 addition & 1 deletion DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/sta_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ int rt_ioctl_iwaplist(struct net_device *dev,
set_quality(pAd, &qual[i], pList); /*&pAd->ScanTab.BssEntry[i]); */
}
data->length = i;
memcpy(extra, &addr, i*sizeof(addr[0]));
memcpy(extra, addr, i*sizeof(addr[0]));
data->flags = 1; /* signal quality present (sort of) */
memcpy(extra + i*sizeof(addr[0]), &qual, i*sizeof(qual[i]));

Expand Down