Skip to content

lwiperf: fix double-free of pcb on error #15272

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

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
028a85c
Add initial version of files
Feb 25, 2022
fc90e9a
Update cmsis files
Feb 25, 2022
f40887a
Remove __R because of confliction
Mar 4, 2022
704bfc7
Add peripheral interface files
Feb 28, 2022
8a2681b
Add peripheral driver files
Feb 28, 2022
65e6595
Fix rtc read issue
Mar 5, 2022
f1bce73
Provide all uart mapping
Mar 8, 2022
24f4738
Provide option to user to drive SS pin too
Mar 8, 2022
9298365
Leave last page of flash
Mar 16, 2022
7826582
Update LP API
Mar 18, 2022
2f813fc
Update system files and mbed wrappers
Mar 18, 2022
8323e9a
Fix GCC_ARM warnings
Mar 28, 2022
4dd0144
utf-8 check
Apr 14, 2022
1bffe35
lwiperf: fix double-free of pcb on error
hifoolno Apr 20, 2022
47a32a0
Merge pull request #15263 from MaximIntegrated/add-MAX32670
0xc0170 Apr 20, 2022
8a59067
github action: update checkout to v3
0xc0170 Apr 19, 2022
ad15f0a
github action: add git safe directory
0xc0170 Apr 20, 2022
decc6d0
Merge pull request #15270 from 0xc0170/fix-test-github-action-git-fai…
0xc0170 Apr 20, 2022
337b811
add the possibility to customize the delimiter of the ATHandler in AT…
Apr 20, 2022
271ed68
STM32L0 : I2C2 was missing
jeromecoutant Apr 19, 2022
173c070
tcp_out: fix tcp_output_fill_options() arguments
hifoolno Apr 20, 2022
d720db5
modify AT_CellularDevice_stub to pass test with the new feature
Tobi15 Apr 21, 2022
9b1d4ee
STM32G4 : add UART5 in IRQ init
jeromecoutant Apr 19, 2022
1985e77
STM32G4 : enable SERIAL_ASYNCH in default configuration
jeromecoutant Apr 19, 2022
904f867
semihosting: Fix typo in semihost_rename
caspermeijn Apr 19, 2022
2d652c9
Merge pull request #15268 from jeromecoutant/PR_L0_I2C2
0xc0170 Apr 26, 2022
d17beb7
Merge pull request #15274 from hifoolno/bug4
0xc0170 Apr 26, 2022
88b6bb0
Merge pull request #15269 from jeromecoutant/PR_G4_UART_ASYNC
0xc0170 Apr 26, 2022
9f326aa
Merge pull request #15271 from caspermeijn/patch-1
0xc0170 Apr 26, 2022
6a8a52a
STM32L0: add MCU_STM32L071xB support
jeromecoutant Apr 29, 2022
2026861
Merge pull request #15277 from jeromecoutant/PR_L071KB
0xc0170 May 2, 2022
de4ea6e
STM32F334xx wrong RAM size
jeromecoutant May 4, 2022
f2c9c60
Merge pull request #15279 from jeromecoutant/PR_F334
0xc0170 May 4, 2022
6467f77
add ITM (SWO) tracing support to Ambiq Apollo3 targets
16L-YT May 5, 2022
fabe70c
Enable ITM (SWO) tracing support to Ambiq Apollo3 targets
16L-YT May 5, 2022
c346404
Bluetooth: Inform privacy risk of using signed writes.
pan- May 6, 2022
7a10808
Add default SWO pin number and config if not defined in Ambiq target
16L-YT May 6, 2022
6fd736b
Merge pull request #15281 from pan-/bluetooth-sign-write-warning
0xc0170 May 9, 2022
e2e927e
Merge pull request #15280 from 16L-YT/master
0xc0170 May 9, 2022
73f2dd6
modify method signatures to pass astyle tests
Tobi15 May 10, 2022
14aa25b
MPS2 CM3DS ethernet fix deprecation warnings
May 11, 2022
cbfda0e
MPS2 CM3DS ethernet fix heap bug
May 11, 2022
f7aca62
MPS2 CM3DS ethernet fix packet bug
May 11, 2022
fdf37c3
MPS2 CM3DS ethernet words instead of bytes
May 11, 2022
58e6bf7
Fix serial low speed baud
pilotak May 13, 2022
15d1b93
Merge pull request #15284 from ramielkhatibPQS/master
0xc0170 May 13, 2022
1ab98de
Merge pull request #15286 from pilotak/master
0xc0170 May 13, 2022
9345c8a
Mbed TLS: Fix wrong MPI N in ECP Curve448 curve
ccli8 May 20, 2022
3adb735
M487: Fix typo with DES H/W port
ccli8 May 24, 2022
b402c97
M487: Fix ECP P + P operation
ccli8 May 24, 2022
b6fadd3
Merge pull request #15289 from OpenNuvoton/nuvoton_m487_des_ecp
0xc0170 May 30, 2022
6170f55
Merge pull request #15287 from OpenNuvoton/nuvoton_fix_ecp-load-curve448
0xc0170 Jun 2, 2022
0905a2e
MTS001 - add custom clock configuration for MTS_MDOT_F411RE to use 26…
reissjason May 31, 2022
4d616cc
MTS002: update MTS_MDOT_F411RE usb clock setting for 8MHz output
reissjason Jun 8, 2022
d994efc
Merge pull request #15273 from Tobi15/main
0xc0170 Jun 10, 2022
4e7b032
Merge pull request #15291 from MultiTechSystems/MTS-001-MTDOT-CLK-FIX
0xc0170 Jun 10, 2022
9704a1b
lwiperf: fix double-free of pcb on error
hifoolno Apr 20, 2022
307a7d7
Merge branch 'bug3' of github.com:xiaohuizhang98/mbed-os into bug3
hifoolno Jun 10, 2022
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
24 changes: 15 additions & 9 deletions .github/workflows/basic_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0


-
name: install dependencies
Expand All @@ -32,7 +33,7 @@ jobs:
run: |
set -x
mkdir -p SCANCODE

git config --global --add safe.directory "$GITHUB_WORKSPACE"
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
| ( grep '.\(c\|cpp\|h\|hpp\|py\)$' || true )
echo $?
Expand Down Expand Up @@ -60,13 +61,14 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

-
name: include check
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
# checks mbed.h is not included in MbedOS files except in tests
! git grep '^#include\s["'"']mbed.h['"'"]$' -- '*.c' '*.h' '*.cpp' '*.hpp' \
':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \
Expand All @@ -81,13 +83,14 @@ jobs:
steps:

- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

-
name: UTF-8 Check
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
# Make sure we're not introducing any text which is not UTF-8 encoded
git diff origin/${GITHUB_BASE_REF} -U0 | ( grep -a '^+' || true ) | ( ! grep -axv '.*' )

Expand All @@ -96,6 +99,7 @@ jobs:
name: astyle checks
run: |
set -x
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
| ( grep '.*\.\(c\|cpp\|h\|hpp\)$' || true ) \
| ( grep -v -f .codecheckignore || true ) \
Expand All @@ -111,7 +115,7 @@ jobs:
steps:

- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down Expand Up @@ -155,7 +159,7 @@ jobs:
steps:
-
name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3


- uses: actions/setup-python@v2
Expand Down Expand Up @@ -184,14 +188,15 @@ jobs:
steps:
-
name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

-
name: validate pins
run: |
set -x
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
| ( grep '.*[\\|\/]PinNames.h$' || true ) \
| while read file; do python ./hal/tests/pinvalidate/pinvalidate.py -vvvfp "${file}"; done
Expand All @@ -210,7 +215,7 @@ jobs:
steps:
-
name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

-
name: cmake build
Expand All @@ -237,14 +242,15 @@ jobs:
steps:
-
name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

-
name: frozen tool check
run: |
set -x
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git diff --name-only origin/${GITHUB_BASE_REF} \
| egrep \
-e "^tools/build_api*" \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docker_management.branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:

-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

-
name: Build docker containers
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:

-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

-
name: Find DEV DOCKER DIGEST
Expand All @@ -178,7 +178,7 @@ jobs:
# development branch of blinky
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ARMmbed/mbed-os-example-blinky
path: mbed-os-example-blinky
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker_management.prune.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

-
name: Delete old temporary images
Expand All @@ -22,4 +22,4 @@ jobs:
# deletion if only one image exists or if DOCKER_MANAGEMENT_TOKEN is not
# setup. This shouldn't create any alarm as temporary image deletion is
# not a critical activity.
python ./.github/workflows/ci_scripts/ghcr_utils.py -u ${{ github.repository_owner }} -p ${{ secrets.DOCKER_MANAGEMENT_TOKEN }} delete-old-images -r mbed-os-env-tmp || true
python ./.github/workflows/ci_scripts/ghcr_utils.py -u ${{ github.repository_owner }} -p ${{ secrets.DOCKER_MANAGEMENT_TOKEN }} delete-old-images -r mbed-os-env-tmp || true
8 changes: 4 additions & 4 deletions .github/workflows/docker_management.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:

-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: refs/tags/${{ steps.build_info.outputs.MBED_OS_VERSION }}

Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
# development branch of blinky
-
name: Checkout example blinky
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ARMmbed/mbed-os-example-blinky
path: mbed-os-example-blinky
Expand All @@ -224,7 +224,7 @@ jobs:

-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: refs/tags/${{ steps.build_info.outputs.MBED_OS_VERSION }}
path: mbed-os-example-blinky/mbed-os
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker_management.test-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# for PR tests, development branch of blinky is used
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ARMmbed/mbed-os-example-blinky
path: mbed-os-example-blinky
Expand All @@ -49,7 +49,7 @@ jobs:

-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: mbed-os-example-blinky/mbed-os

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/greentea_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
container: ghcr.io/armmbed/mbed-os-env:master-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install the latest mbed-tools
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Python environment
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Checkout mbed-os-scripts repo (This repo is currently private)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ARMmbed/mbed-os-ci-scripts
token: ${{ secrets.ISSUE_TRIAGING_PERMS }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
container: mbedos/mbed-os-env:latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: mbed-os

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_building_multiple_executables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
container: ghcr.io/armmbed/mbed-os-env:master-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Build the multiple_executables example
run: |
Expand Down
16 changes: 16 additions & 0 deletions connectivity/FEATURE_BLE/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,19 @@ This is the Github repository for the `BLE_API`. Please see the [Mbed OS Example
* [Mbed OS example BLE GitHub repo](https://github.com/ARMmbed/mbed-os-example-ble) for all Mbed OS BLE examples.
* [Mbed OS BLE introduction](https://os.mbed.com/docs/latest/apis/ble.html) for an introduction to Mbed BLE.
* [Mbed OS BLE API page](https://os.mbed.com/docs/latest/apis/bluetooth.html) for the Mbed BLE API documentation.

## Privacy notice

The Cordio Bluetooth stack only stores one single signing key. This key is then
shared across all bonded devices. If a malicious device bonds with the Mbed OS
application it then gains knowledge of the shared signing key of the Mbed OS device.
The malicious device can then track the Mbed OS device whenever a signing write
is issued from it.

To overcome this privacy issue do not issue signed writes from the Mbed OS device.
A signed write occurs when the member function `write` of `GattClient` is called
with its `cmd` argument set to `GATT_OP_SIGNED_WRITE_CMD`.

Instead of using signed writes, enable encryption on the connection. This is achieved
by calling the function `setLinkEncryption` of the `SecurityManager`. Set the encryption
to at least `ENCRYPTED`.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AT_CellularDevice : public CellularDevice {
};

public:
AT_CellularDevice(FileHandle *fh);
AT_CellularDevice(FileHandle *fh, char *delim = "\r");
virtual ~AT_CellularDevice();

virtual nsapi_error_t clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ using namespace std::chrono_literals;
#define DEFAULT_AT_TIMEOUT 1s // at default timeout
const int MAX_SIM_RESPONSE_LENGTH = 16;

AT_CellularDevice::AT_CellularDevice(FileHandle *fh) :
AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char *delim):
CellularDevice(),
_at(fh, _queue, DEFAULT_AT_TIMEOUT, "\r"),
_at(fh, _queue, DEFAULT_AT_TIMEOUT, delim),
#if MBED_CONF_CELLULAR_USE_SMS
_sms(0),
#endif // MBED_CONF_CELLULAR_USE_SMS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ bool AT_CellularDevice_stub::pin_needed = false;
bool AT_CellularDevice_stub::supported_bool = false;
int AT_CellularDevice_stub::max_sock_value = 1;

AT_CellularDevice::AT_CellularDevice(FileHandle *fh) :
AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char *delim) :
CellularDevice(),
_at(fh, _queue, get_property(AT_CellularDevice::PROPERTY_AT_SEND_DELAY), "\r"),
_at(fh, _queue, get_property(AT_CellularDevice::PROPERTY_AT_SEND_DELAY), delim),
#if MBED_CONF_CELLULAR_USE_SMS
_sms(0),
#endif // MBED_CONF_CELLULAR_USE_SMS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,13 @@ emac_mem_buf_t *SMSC9220_EMAC::low_level_input()
message_length -= CRC_LENGTH_BYTES;
}

p = _memory_manager->alloc_heap(SMSC9220_ETH_MAX_FRAME_SIZE,
p = _memory_manager->alloc_heap(message_length,
SMSC9220_BUFF_ALIGNMENT);

if (p != NULL) {
_RXLockMutex.lock();
received_bytes = smsc9220_receive_by_chunks(dev,
(char*)_memory_manager->get_ptr(p),
_memory_manager->get_len(p));
received_bytes = smsc9220_receive_packet(dev,
_memory_manager->get_ptr(p));
if(received_bytes == 0){
_memory_manager->free(p);
p = nullptr;
Expand Down Expand Up @@ -148,7 +147,6 @@ bool SMSC9220_EMAC::link_out(emac_mem_buf_t *buf)
if(buf == NULL) {
return false;
} else {
uint32_t buffer_chain_length = 0;
enum smsc9220_error_t error = SMSC9220_ERROR_NONE;
/* If buffer is chained or not aligned then
* make a contiguous aligned copy of it */
Expand All @@ -170,16 +168,12 @@ bool SMSC9220_EMAC::link_out(emac_mem_buf_t *buf)
buf = copy_buf;
}

buffer_chain_length = _memory_manager->get_total_len(buf);

_TXLockMutex.lock();
error = smsc9220_send_by_chunks(dev,
buffer_chain_length,
true,
(const char*)_memory_manager->get_ptr(buf),
error = smsc9220_send_packet(dev,
_memory_manager->get_ptr(buf),
_memory_manager->get_len(buf));
_memory_manager->free(buf);
_TXLockMutex.unlock();
_TXLockMutex.unlock();
return (error == SMSC9220_ERROR_NONE);
}
}
Expand Down Expand Up @@ -211,7 +205,7 @@ bool SMSC9220_EMAC::power_up()
this));

/* Initialize the hardware */
enum smsc9220_error_t init_successful = smsc9220_init(dev, &ThisThread::sleep_for);
enum smsc9220_error_t init_successful = smsc9220_init(dev, &thread_sleep_for);
if (init_successful != SMSC9220_ERROR_NONE) {
return false;
}
Expand All @@ -237,7 +231,7 @@ bool SMSC9220_EMAC::power_up()
&SMSC9220_EMAC::link_status_task));

/* Allow the Link Status task to detect the initial link state */
ThisThread::sleep_for(10);
ThisThread::sleep_for(10ms);
_link_status_task_handle = mbed::mbed_event_queue()->call_every(
LINK_STATUS_TASK_PERIOD_MS,
mbed::callback(this,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define FLAG_RX 1U
#define LINK_STATUS_THREAD_PRIORITY (osPriorityNormal)
#define LINK_STATUS_THREAD_STACKSIZE 512U
#define LINK_STATUS_TASK_PERIOD_MS 200U
#define LINK_STATUS_TASK_PERIOD_MS 200ms
#define PHY_STATE_LINK_DOWN false
#define PHY_STATE_LINK_UP true
#define CRC_LENGTH_BYTES 4U
Expand Down
Loading