Commit Graph
345619 Commits
Author SHA1 Message Date
Zhang Xiaoxu 108a951bdf vgacon: Fix a UAF in vgacon_invert_region
commit 513dc792d6060d5ef572e43852683097a8420f56 upstream.

When syzkaller tests, there is a UAF:
  BUG: KASan: use after free in vgacon_invert_region+0x9d/0x110 at addr
    ffff880000100000
  Read of size 2 by task syz-executor.1/16489
  page:ffffea0000004000 count:0 mapcount:-127 mapping:          (null)
  index:0x0
  page flags: 0xfffff00000000()
  page dumped because: kasan: bad access detected
  CPU: 1 PID: 16489 Comm: syz-executor.1 Not tainted
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
  rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
  Call Trace:
    [<ffffffffb119f309>] dump_stack+0x1e/0x20
    [<ffffffffb04af957>] kasan_report+0x577/0x950
    [<ffffffffb04ae652>] __asan_load2+0x62/0x80
    [<ffffffffb090f26d>] vgacon_invert_region+0x9d/0x110
    [<ffffffffb0a39d95>] invert_screen+0xe5/0x470
    [<ffffffffb0a21dcb>] set_selection+0x44b/0x12f0
    [<ffffffffb0a3bfae>] tioclinux+0xee/0x490
    [<ffffffffb0a1d114>] vt_ioctl+0xff4/0x2670
    [<ffffffffb0a0089a>] tty_ioctl+0x46a/0x1a10
    [<ffffffffb052db3d>] do_vfs_ioctl+0x5bd/0xc40
    [<ffffffffb052e2f2>] SyS_ioctl+0x132/0x170
    [<ffffffffb11c9b1b>] system_call_fastpath+0x22/0x27
    Memory state around the buggy address:
     ffff8800000fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00
     ffff8800000fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00
    >ffff880000100000: ff ff ff ff ff ff ff ff ff ff ff ff ff
     ff ff ff

It can be reproduce in the linux mainline by the program:
  #include <stdio.h>
  #include <stdlib.h>
  #include <unistd.h>
  #include <fcntl.h>
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <sys/ioctl.h>
  #include <linux/vt.h>

  struct tiocl_selection {
    unsigned short xs;      /* X start */
    unsigned short ys;      /* Y start */
    unsigned short xe;      /* X end */
    unsigned short ye;      /* Y end */
    unsigned short sel_mode; /* selection mode */
  };

  #define TIOCL_SETSEL    2
  struct tiocl {
    unsigned char type;
    unsigned char pad;
    struct tiocl_selection sel;
  };

  int main()
  {
    int fd = 0;
    const char *dev = "/dev/char/4:1";

    struct vt_consize v = {0};
    struct tiocl tioc = {0};

    fd = open(dev, O_RDWR, 0);

    v.v_rows = 3346;
    ioctl(fd, VT_RESIZEX, &v);

    tioc.type = TIOCL_SETSEL;
    ioctl(fd, TIOCLINUX, &tioc);

    return 0;
  }

When resize the screen, update the 'vc->vc_size_row' to the new_row_size,
but when 'set_origin' in 'vgacon_set_origin', vgacon use 'vga_vram_base'
for 'vc_origin' and 'vc_visible_origin', not 'vc_screenbuf'. It maybe
smaller than 'vc_screenbuf'. When TIOCLINUX, use the new_row_size to calc
the offset, it maybe larger than the vga_vram_size in vgacon driver, then
bad access.
Also, if set an larger screenbuf firstly, then set an more larger
screenbuf, when copy old_origin to new_origin, a bad access may happen.

So, If the screen size larger than vga_vram, resize screen should be
failed. This alse fix CVE-2020-8649 and CVE-2020-8647.

Linus pointed out that overflow checking seems absent. We're saved by
the existing bounds checks in vc_do_resize() with rather strict
limits:

	if (cols > VC_RESIZE_MAXCOL || lines > VC_RESIZE_MAXROW)
		return -EINVAL;

Fixes: 0aec4867dc ("[PATCH] SVGATextMode fix")
Reference: CVE-2020-8647 and CVE-2020-8649
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
[danvet: augment commit message to point out overflow safety]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200304022429.37738-1-zhangxiaoxu5@huawei.com
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
CVE-2020-8647
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
Change-Id: I38134ca1efd924ba852e4c1723a5924399c68f24
2020-08-08 16:41:32 +02:00
Trishansh Bhardwaj 17cad8e6a8 msm: camera: Instead of read_lock use read_lock_irqsave.
Prevent deadlock between tasklet and delete_stream by stopping
irq during delete_stream.

CRs-Fixed: 2076578
Change-Id: Ibcc9fd44403d24112b01150a7d1f3c6e705ea99a
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
Signed-off-by: VijayaKumar T M <vtmuni@codeaurora.org>
CVE-2017-9704
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2020-08-08 16:41:14 +02:00
Manish Poddar c7dfc3df1d msm: camera: Fix Use after free bug in msm_vb2.c.
There is no syncronization between msm_vb2_get_buf
and msm_delete_stream which can lead to use after
free.
Fixed it by using read/write lock.

Change-Id: I8e80d70ec866253aab8836457a28ae14175f5d61
Signed-off-by: Manish Poddar <mpoddar@codeaurora.org>
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
[haggertk: Backport to 3.4/msm8974. Note that this includes patching
 the non-standard camera_ll implementation as well on this kernel.]
CVE-2017-9704
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2020-08-08 16:39:39 +02:00
Kevin F. Haggerty c2e47eaa03 msm: camera: Ratelimit "skip hw update" error in msm_isp_proc_cmd()
* This pr_err, added by Samsung, is annoyingly spammy

Change-Id: I4cbdf5ee67faa21051c8652cf2e3e3b3b94c2613
2020-08-08 16:20:03 +02:00
Lakshmi Narayana Kalavala 6cf9ae715a msm: camera: Fix memory corruption with vb2 buffers
The camera generic buffer manager and isp buffer
manager keep references of vb2 buffers locally during
buffer circulation. If for some reason the vb2 buffers
are freed from a cleanup call from mediaserver. The memory
for the buffers is freed. But the camera buffer managers
still access them for a fraction of time before the cleanup
call is triggered from daemon process. Hence make sure
to access the vb2 buffers only after checking for
the existence in vb2 queues to avoid memory corruption.

Change-Id: I7a1e5f9a3af3345e0c37d3208facbab107a6b9ed
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2020-08-08 16:15:00 +02:00
Trishansh Bhardwaj 35e3566eac msm: camera: Retelimit log in msm_vb2_buf_cleanup.
Ratelimit log in msm_vb2_buf_cleanup to prevent excessive logging when
stream is NULL.

Change-Id: Ia687375c8e2a2683a4d32cd0eb984f731b2288e7
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2020-08-08 14:52:55 +02:00
Hiroshi DOYU 8d89b49455 driver core: Add dev_*_ratelimited() family
Add dev_*_ratelimited() family, dev_* version of pr_*_ratelimited().

Using Joe Perches's proposal/implementation.

Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
Change-Id: I6f0f4f8f61de2dd5331eff202b66c931700bbf27
2020-08-08 14:52:26 +02:00
syphyr e89888971a msm: camera: Return EINVAL when msm_get_session fails
Do not return 0 if msm_get_session fails on session_id.

Change-Id: Iad8b72e33c3a613da3f16693fce9aaf862de9ac5
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2020-08-08 14:51:32 +02:00
Soumya Managoli 76e0a16113 dsp: adm: Fix to avoid memory overread in adm callback
For ADM_CMDRSP_GET_PP_PARAMS_V5 cmd response,
the check for data payload_size is incorrect.
Modify the check condition to make sure there
is enough data to copy, size is contained in
payload[3].

Change-Id: I2f155ad8b302e89131ee85cfc72e4009dda617d3
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
CVE-2019-14038
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2020-08-08 14:50:23 +02:00
Sean Tranchetti f5043e0d50 xfrm: validate template mode
XFRM mode parameters passed as part of the user templates
in the IP_XFRM_POLICY are never properly validated. Passing
values other than valid XFRM modes can cause stack-out-of-bounds
reads to occur later in the XFRM processing:

[  140.535608] ================================================================
[  140.543058] BUG: KASAN: stack-out-of-bounds in xfrm_state_find+0x17e4/0x1cc4
[  140.550306] Read of size 4 at addr ffffffc0238a7a58 by task repro/5148
[  140.557369]
[  140.558927] Call trace:
[  140.558936] dump_backtrace+0x0/0x388
[  140.558940] show_stack+0x24/0x30
[  140.558946] __dump_stack+0x24/0x2c
[  140.558949] dump_stack+0x8c/0xd0
[  140.558956] print_address_description+0x74/0x234
[  140.558960] kasan_report+0x240/0x264
[  140.558963] __asan_report_load4_noabort+0x2c/0x38
[  140.558967] xfrm_state_find+0x17e4/0x1cc4
[  140.558971] xfrm_resolve_and_create_bundle+0x40c/0x1fb8
[  140.558975] xfrm_lookup+0x238/0x1444
[  140.558977] xfrm_lookup_route+0x48/0x11c
[  140.558984] ip_route_output_flow+0x88/0xc4
[  140.558991] raw_sendmsg+0xa74/0x266c
[  140.558996] inet_sendmsg+0x258/0x3b0
[  140.559002] sock_sendmsg+0xbc/0xec
[  140.559005] SyS_sendto+0x3a8/0x5a8
[  140.559008] el0_svc_naked+0x34/0x38
[  140.559009]
[  140.592245] page dumped becaus: kasan: bad access detected
[  140.597981] page_owner info is not active (free page?)
[  140.603267]
[  140.653503] ================================================================

Change-Id: I5d2fa78a9d950c79d83d759bfd4d0f399fed18a4
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
CVE-2019-14053
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2020-08-08 14:50:16 +02:00
prototype74 51c1a30710 arch: arm: defconfigs: lineage_*: enable to interactive governor
Change-Id: Ie88028c39a6d6b14b8579bd7272ba315af4ccc41
2020-07-05 18:48:06 +02:00
Manjeet Singh e2b4a4267e wlan: Add buf len check in wlan_hdd_cfg80211_testmode
In __wlan_hdd_cfg80211_testmode API no checks are in place that
ensure that buflen is smaller or equal the size of the stack
variable hb_params. Hence, the vos_mem_copy() call can overflow
stack memory.

Add buf len check to avoid stack overflow.

Issue: SEC-2081
CRs-Fixed: 1105085
Change-Id: I6af6a74cc38ebce3337120adcf7e9595f22d3d8c
(adapted from commit a577dc1838b92eb0e7ecf16401e7a2b5e3238e61)
2020-05-21 10:56:02 +02:00
Pankaj Singh 485ef5bd5a wlan: Avoid queuing multiple WM status change cmd for same peer
propagation from qcacld-3.0 to prima

In SAP mode, one peer sends multiple deauth frames which
results in queuing multiple WM status change cmd which
is added at head of queue. WM status change cmd is added
at head of queue for other peers which results in delay
in processing the cmd for first peer. The WM status cmd
is processed and peer is deleted and connection is
initiated by the same peer. The remaining WM status change
cmd is now processed and del_sta is triggered. On receiving
del_sta response, cleanup_trigger in sta_ds is checked
and eWNI_SME_DISASSOC_RSP message is posted to SME instead
of eWNI_SME_DISCONNECT_DONE_IND since the sta_ds entry
is added newly. This will result in active command timeout
since WM status change cmd is not removed from active queue.

Fix is to drop deauth or disassoc frame after the first one
is processed and use normal priority to queue WM status
change cmd.

Change-Id: Ib87fa7496d4adb6e25c30de657ce62101ca6f263
CRs-Fixed: 2598899
2020-05-21 10:56:01 +02:00
Wu Gao 398dd664eb wlan: Fix potential OOB read when indicate mgmt frame
qcacld-2.0 to prima propagation.

In function __hdd_indicate_mgmt_frame, it doesn't check mgmt frame
length and access pointer to frame, which cause OOB read potentially.
So, check frame length before access pointer to frame.

Change-Id: Id2bd4276838f1eae49e8a24e8ab3361a69321a69
CRs-Fixed: 2525198
2020-05-21 10:56:00 +02:00
Abhishek Ambure e91342e9c0 wlan: Add max index check for dscp_to_up_map array
qcacld-3.0 to prima propagation.

In SME layer, boundary check for dscp_to_up_map array is not present.

The dscpmapping is an array of 0x40 elements. Values in dscp_exceptions
are used to index dscpmapping. The indices are not validated to be less
than 0x40. The dscp_exceptions array is received from association
response frame. A malicious AP can send values up to 0xff, causing OOB
write of dscpmapping array.

Hence, max index check is added to avoid OOB write of dscpmapping array.

Change-Id: I73526849677e867673fc0bd0024ed2b003e4f89e
CRs-Fixed: 2585141
2020-05-21 10:56:00 +02:00
Yeshwanth Sriram Guntuka 14e6d74e87 wlan: Fix possible OOB access in lim_process_disassoc_frame
Reason code is extracted from frame data without validating
the frame len which could result in out of bound access.

Fix is to validate frame len before extracting reason
code from frame data.

Change-Id: I00795a806abcae903dd0daa019aeab990aedc3a7
CRs-Fixed: 2504023
2020-05-21 10:55:59 +02:00
Pragaspathi Thilagaraj cfca93bec9 wlan: Fix possible integer underflow in cfg80211_rx_mgmt
In the function cfg80211_rx_mgmt, data_len is calculated as
len - ieee80211_hdrlen(mgmt->frame_control). Len is not
validated before this calculation. So a possible integer
underflow will occur if len value is less than the value of
ieee80211_hdrlen(mgmt->frame_control).

Validate the value of len against
ieee80211_hdrlen(mgmt->frame_control) in the caller.

Change-Id: Iae776daf37b0c052bd4ce4da44ea728d121eae51
CRs-Fixed: 2460252
2020-05-21 10:55:58 +02:00
Marco Zhang dce87c8541 wlan: Fix OOB read in sme_RrmProcessBeaconReportReqInd
Propagate from cld-3.0 to prima.

When beacon report request action frame is received,
rrmProcessBeaconReportReq() is called and num_channels value
is calculated from the action frame directly from user. This
value is assigned to pSmeBcnReportReq->channelList.numChannels
and this num channels value along with the channel list is
posted to sme for further processing. The sme function
sme_RrmProcessBeaconReportReqInd() processes this sme
message eWNI_SME_BEACON_REPORT_REQ_IND. In this function,
the channels in channel list are looped through the received
value pBeaconReq->channelList.numChannels and is copied to the
destination pSmeRrmContext->channelList array from the
pBeaconReq->channelList.channelNumber[] array.
The maximum possible number of channels in channel list
BeaconReq->channelList.channelNumber[] allocated statically
in the definition of tSirChannelList is
SIR_ESE_MAX_MEAS_IE_REQS (8).
So when the pBeaconReq->channelList.numChannels, possible OOB
read occurs.

Validate the value of pBeaconReq->channelList.numChannels
received from the action frame against the maximum supported
number of channels in channel list SIR_ESE_MAX_MEAS_IE_REQS (8).
Place this validation inside the function
sme_RrmProcessBeaconReportReqInd() instead of validating it
at rrmProcessBeaconReportReq() so that it defends from other
caller sme_SetEseBeaconRequest() which is from user space
command through IOCTL.

Change-Id: I2074b04081328ceab7eeb29c33631a635e9d93c3
CRs-Fixed: 2462152
2020-05-21 10:55:51 +02:00
Abhinav Kumar 6bfbb0e40f prima: Possible buff overflow in sir_convert_assoc_resp_frame2_struct
This was backported from qcacld-3.0.

After parsing of Re/Association Response frame,
sir_convert_assoc_resp_frame2_struct populates association response
structure sSirAssocRsp. In case if FEATURE_WLAN_ESE is enabled,
the host runs a loop to memcopy for all WMM TSPEC info from the parsed
buffer to association response structure.
Currently, While copying parsed data to sSirAssocRsp,
sir_convert_assoc_resp_frame2_struct is passing (sizeof(tDot11fIEWMMTSPEC)
* ar->num_WMMTSPEC)) as length argument to qdf_mem_copy to copy individual
TSPECInfo, which results to buffer overflow, as size of per
TSPECInfo is only sizeof(tDot11fIEWMMTSPEC).

Pass correct length to qdf_mem_copy while coping TSPECInfo.

Change-Id: I9c74e3bbd387fda736a715625260d95c67f03ecc
CRs-Fixed: 2254946
2020-05-21 10:55:46 +02:00
Pragaspathi Thilagaraj f966ee8ebb prima: Fix integer truncation in convert_wsc_opaque
This was backported from qcacld-3.0.

In the function convert_wsc_opaque, driver does copy of the
new parameters present in the additional IEs of the upstream
assoc request frame. While copy of the IE length pOld->length to
curAddIELen, possible integer truncation could occur, as the
curAddIELen is of the type uint8_t whereas pOld->length is of
type uint16_t.

Change the data type of curAddIELen to uint16_t. Make changes in
convert_p2p_opaque and convert_wfd_opaque as well.

Change-Id: Ic26660fca4a02a265bfc9553b066c7ee42f1d1f4
CRs-Fixed: 2231770
2020-05-21 10:55:46 +02:00
Srinivas Girigowda bf9446a20f prima: Trim extn capability to max supported in change station
extn capabilities can be controlled by user, which can
be sent greater than the max supported value. This results
in stack overflow in change station command.

Add check to validate extn capability param given by user
and if it exceeds max supported value, set it to max supported
value.

CRs-Fixed: 2044820
Change-Id: I531799dd06c41069e85ad969de6182363dbf9f05
Bug: 36817798
Signed-off-by: Srinivas Girigowda <sgirigow@codeaurora.org>
2020-05-21 10:55:45 +02:00
hqu 6347c8aaa2 qcacld-2.0: Fix possible OOB in limProcessAssocReqFrame
propagation from qcacld-3.0 to qcacld-2.0

In the function limProcessAssocReqFrame, if wpa IE is
present, then dot11fUnpackIeWPA is called to copy the wpa IE
to destination buffer. pAssocReq->wpa.length is passed as the
length to copy the IE. As this length includes 4 bytes of the
OUI fields also, this could result in OOB read.

Change the length passed to the dot11fUnpackIeWPA as
(pAssocReq->wpa.length - 4), so that the additional 4 bytes of
the OUI fields are excluded.

Change-Id: If972b3a19d239bb955c7b4d4c7d94e25aa878f21
CRs-Fixed: 2406159
2020-05-21 10:55:44 +02:00
lifeng 1cfe8ed412 qcacld-2.0: Fix possible buffer overflow in sirConvertAddtsRsp2Struct
propagation from qcacld-3.0 to qcacld-2.0

In the function sirConvertAddtsRsp2Struct, iterator j is
assigned with the value pAddTs->numTclas + addts.num_WMMTCLAS.
The j value is used as the index to the array pAddTs->tclasInfo.
Maximum limit on  pAddTs->tclasInfo entries is 2. So when the
value of j exceeds 2, then a possible buffer overflow could
occur.

Validate the value of j against SIR_MAC_TCLASIE_MAXNUM(2).

Change-Id: Icc723380ed4ccd51c729194d509e288be0e0712c
CRs-Fixed: 2419829
2020-05-21 10:55:44 +02:00
Sourav Mohapatra 1dd03c08ed qcacld-3.0: Avoid buffer overflow when process SA query action frame
No frame length check when extract 11w transaction id from SA
query request and response action frame, if frame length is
shorter than expected, buffer overflow will happen

Change-Id: Iddefa809023da244564cfd227ccfe8c2de5717c0
CRs-Fixed: 2407089
2020-05-21 10:55:43 +02:00
Yeshwanth Sriram Guntuka 708290b937 wlan: Skip IE which has length less than the minimum valid IE length
QBSS IE uses min length of 4 bytes for version 1 and
min length of 5 bytes for version 2. Min length used
for IE is 5 bytes in driver which can cause WPA IE
parse failure if QBSS IE is 4 bytes resulting in failure
in fetching scan results due to security mismatch and
subsequently connection failure.

Fix is to skip the IE which has length less than the
minimum valid length.

Change-Id: I00fbffad221e2d9ecedcb87c9607ac8abd7c55b1
CRs-Fixed: 2348006
2020-05-21 10:55:42 +02:00
gaurank kathpalia 0b1ee747f3 wlan: Fix OOB read in limProcessDeauthFrame
Propagation from cld2.0 to prima
In the API limProcessDeauthFrame, the reason-code is
fetched from the payload, and it may happen that the
payload received is empty, and the MPDU just contains the
header, so the driver may access the memory not allocated
to the frame, thus resulting in a OOB read.

Fix is to have a min length check of 16 bits for the
reason code before accessing it.

Change-Id: I7e7a435ba049356c13fb10240f4abb9bf6219af4
CRs-Fixed: 2341590
2020-05-21 10:55:42 +02:00
Ashish Kumar Dhanotiya bcfcb1c021 wlan: Avoid possible information leak in send_btc_nlink_msg
In function send_btc_nlink_msg skb alloc is done but the allocated
memory is not initialized. NLMSG_SPACE is used at many places in this
function which does 4 bytes allignment of the buffer. skb_put
adjusts the tail pointer according to this 4 byte allignment results
in padding some extra bytes. Since these bytes are not initialized
it leads to information leak.

To resolve this issue, initialize the skb with zero after alloc skb.

Change-Id: I9d4d2030927c4aedf8c201bf875741b8c800ee7e
CRs-Fixed: 2288807
2020-05-21 10:55:41 +02:00
gaurank kathpalia 77e1d1384c wlan: Increase size of MAX_WPA_RSN_IE_LEN in wlan_hdd_cfg80211_set_ie
In function wlan_hdd_cfg80211_set_ie, RSN IE is parsed and copied
into the buffer pWextState->WPARSNIE for length eLen + 2.
However, the buffer WPARSNIE is allocated only for MAX_WPA_RSN_IE_LEN
size. If eLen + 2 is greater than MAX_WPA_RSN_IE_LEN, a buffer overflow
would occur.

Increase the size of MAX_WPA_RSN_IE_LEN to 255 as per the spec

Change-Id: Ibf44e8dc1010e6e32b2262357d3aa180926d5c99
CRs-Fixed: 2299183
2020-05-21 10:55:40 +02:00
kaiyiz bc6fa3ea91 prima: Fix buffer overwrite in limMlmAddBss()
Fix buffer overwrite in limMlmAddBss() by adding
validation check.

Change-Id: I322c6d725e6bbb3c470b2141392a810c2616e9ad
2020-05-21 10:55:40 +02:00
Vignesh Viswanathan 2ebd6e5326 wlan: Check ac in limSetEdcaBcastACMFlag
Ac comes from user space. Add check for ac in
limSetEdcaBcastACMFlag to avoid out-of-bounds write.

Change-Id: Id71cacc1cdadacaabe775395dc0cb230091bc21b
CRs-Fixed: 2298563
2020-05-21 10:55:39 +02:00
Marco Zhang 99653e2aad Copyright date fix
Change-Id: Id64036c79967e0182857ef3e9768fcbab88c63a9
2020-05-21 10:55:38 +02:00
Sourav Mohapatra d5ba518b8f wlan: hdd: Replace instances of unadorned %p
Replace instances of unadorned %p in CORE/HDD.

Change-Id: I32b89aaf6a8b1ca3177e0c1cb5cec5fbc5f5294a
CRs-Fixed: 2111275
2020-05-21 10:55:38 +02:00
Hanumanth Reddy Pothula bb73fcc012 wlan: Resolve overflow while processing setHostOffload ioctl
qcacld-2.0 to prima propagation

While processing setHostOffload ioctl there is a possibility of
sending invalid data to lower layers as user sent data structure
is different from local buffer structure.
To mitigate this issue, initialize local buffer to zero and then
update local buffer member by member.

Change-Id: I657d2a8c7d37435b1ad28ef6de60ea80a235ead9
CRs-Fixed: 2147130
2020-05-21 10:55:37 +02:00
Pragaspathi Thilagaraj 8d935f40c8 wlan: Check for return codes of dot11f_unpack functions
Add checks for return codes of dot11f_unpack functions.

Change-Id: I56149a2a767a9f13009710750a0588c0d658eb56
CRs-Fixed: 2213317
2020-05-21 10:55:36 +02:00
Jeff Johnson 6a1ee03d74 wlan: mac: Replace instances of unadorned %p
Replace instances of unadorned %p in CORE/MAC.

Change-Id: Id9b15d369dda7660f292e6c961b25d2e8270b141
CRs-Fixed: 2111275
2020-05-21 10:55:35 +02:00
Jeff Johnson ee711fe1c5 wlan: sap: Replace instances of unadorned %p
Replace instances of unadorned %p in CORE/SAP.

Change-Id: I37a803518430313d360d10e429469fa7bb471b78
CRs-Fixed: 2111275
2020-05-21 10:55:35 +02:00
Jeff Johnson cefb3e66fe wlan: voss: Replace instances of unadorned %p
Replace instances of unadorned %p in CORE/VOSS.

Change-Id: I4582c890aa0ad5a2caa5c8622c2d1f7e9fb11cbb
CRs-Fixed: 2111275
2020-05-21 10:55:34 +02:00
Jeff Johnson 3f072f56b3 wlan: wda: Replace instances of unadorned %p
Replace instances of unadorned %p in CORE/WDA.

Change-Id: Ic550a5a317214885b107f6f170ab52ced2494c20
CRs-Fixed: 2111275
2020-05-21 10:55:33 +02:00
Rajeev Kumar Sirasanagandla 3ceb758e3b wlan: Check for space termination of driver command name
qcacld-2.0 to prima propagation.

Currently, few hdd driver commands and hostapd driver commands which
expect input are not checked for space termination of command name.
Skip of this check can result in buffer overread error.

To fix this, add check based on the length of command name.

Change-Id: I92a4efd7e729a9d792af166b4a09963886c9942f
CRs-Fixed: 2096872
2020-05-21 10:55:33 +02:00
Jeff Johnson cbb175fe2f wlan: sme: Replace instances of unadorned %p
Replace instances of unadorned %p in CORE/SME.

Change-Id: I8176263cf21ec7281dd5ebbaecbe1c8568465a37
CRs-Fixed: 2111275
2020-05-21 10:55:32 +02:00
Jeff Johnson 63d625a605 wlan: svc: Replace instances of unadorned %p
Replace instances of unadorned %p in CORE/SVC.

Change-Id: I46bf810d449fdbed352e0d8c5dbfae9a5fb14801
CRs-Fixed: 2111275
2020-05-21 10:55:31 +02:00
Jeff Johnson 4dd6bca57b wlan: tl: Replace instances of unadorned %p
Replace instances of unadorned %p in CORE/TL.

Change-Id: Ife5519f2181bd640520f0c181cedd8d0613b84a9
CRs-Fixed: 2111275
2020-05-21 10:55:31 +02:00
Jeff Johnson 971487845e wlan: bap: Replace instances of unadorned %p
Replace instances of unadorned %p in CORE/BAP.

Change-Id: Ia7a4b72b425f0f453b9d2b47917153e975667f96
CRs-Fixed: 2111275
2020-05-21 10:55:30 +02:00
Agrawal Ashish 063cde0d5a wlan: Fix Integer overflow with latest framesc_linux tool
In GetContainerIesLen size type for len is tANI_U8.
len copies values from pBufRemaining.
There can be chance for integer overflow.
To avoid that make size type for len as tANI_U32.

Change-Id: I305321a6631719808ef213571974ae23b0e61bb3
CRs-Fixed: 2086140
2020-05-21 10:55:29 +02:00
Jeff Johnson 723b5a79d7 wlan: dxe: Replace instances of unadorned %p
Replace instances of unadorned %p in CORE/DXE.

Change-Id: Id8cac72868bdd8f894d17304487db593f3816bb6
CRs-Fixed: 2111275
2020-05-21 10:55:29 +02:00
gaurank kathpalia b368da61bc wlan: Fix Out-of-bound access in sapInterferenceRssiCount
Fix Out-of-bound access in sapInterferenceRssiCount, by checking
the limit of start address for channel info and end address for
channel info.

Change-Id: If21e09d0f11bd655a8e04139ccf55d3682734b17
CRs-Fixed: 2149350
2020-05-21 10:55:28 +02:00
Nachiket Kukade 6400560b2a wlan: Add maximum bound check on WPA RSN IE length
In set_ie after receiving DOT11F_EID_RSN, WPA RSN IE is copied from
source without a check on the given IE length. A malicious IE length
can cause buffer overflow.

Apply the same logic from Id159d307e8f9c1de720d4553a7c29f23cbd28571
that was applied under DOT11F_EID_WPA. This adds maximum bound check
on WPA RSN IE length.

Change-Id: I04f980fe44328b1a3f6a6d4854228cc4c9f1a1c7
CRs-Fixed: 2177210
2020-05-21 10:55:04 +02:00
gaurank kathpalia 33c6e61d2d wlan: Remove palPktFree in assoc request api
In the API limSendAssocReqMgmtFrame, the host
allocates memory for the assoc request packet
taking all inputs of payload and the mac header
size etc, and in case the mem allocation fails
it clears away the memory allocated to the packet
with palPktFree, which was not even allocated

Fix is to remove the packet free in case of memory not
allocated

Change-Id: I3fb75b1947dfe039605c42aa19c2d0bacc7bf55d
CRs-Fixed: 2280194
2020-05-21 10:55:04 +02:00
Yeshwanth Sriram Guntuka 76217eecb4 wlan: Fix buffer overwrite in csrRoamCheckForLinkStatusChange
Fix possible buffer overwrite in csrRoamCheckForLinkStatusChange
function on receiving eSIR_SME_JOINED_NEW_BSS message.

Change-Id: Icf4a39e0a2a291f1c084353985aa7952e3c8e136
CRs-Fixed: 2294790
2020-05-21 10:55:03 +02:00
Yeshwanth Sriram Guntuka 7eeb3b125a wlan: Avoid int overflow in csrScanSavePreferredNetworkFound
Add validation check on frameLength to avoid int overflow in
csrScanSavePreferredNetworkFound function.

Change-Id: I0f2a0557fa60e81f0b9d003ae73091f2974046e8
CRs-Fixed: 2294807
2020-05-21 10:55:02 +02:00