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

LwM2M: Block transfer with TLV format does not work #34935

Closed
jb-gcx opened this issue May 6, 2021 · 0 comments · Fixed by #34936
Closed

LwM2M: Block transfer with TLV format does not work #34935

jb-gcx opened this issue May 6, 2021 · 0 comments · Fixed by #34936
Assignees
Labels
area: LWM2M area: Networking bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Milestone

Comments

@jb-gcx
Copy link
Contributor

jb-gcx commented May 6, 2021

Describe the bug
When writing an opaque resource with block transfer using the TLV format, the first block is received and interpreted correctly. The payload of the second block is interpreted by the code as a new TLV tuple, even though it doesn't repeat the TLV header. This causes the first bytes of the payload in the second block to be interpreted as a TLV header, resulting in an arbitrary type and length.

To Reproduce

  1. Write to an opaque resource using block transfer in TLV format (tested with a Leshan server)
  2. See in the postwrite callback of the resource that it is not received correctly
  3. Modify the payload at the start of the second block to see that the behavior changes depending on those bytes

Expected behavior
Blocks after the first one are properly processed and forwarded to the postwrite callback.

Impact
Block transfer is impossible, making it impossible to write opaque resources with more than 1024 bytes.

Environment (please complete the following information):

  • OS: MacOS
  • Toolchain: gcc-arm-none-eabi-10-2020-q4-major
  • Commit SHA or Version used: 4ce908a (nordics fork)

Additional context

This same issue seems to have been fixed specifically for the firmware package (5/0/0), see here. But the issue occurs on a custom opaque resource as well.

@jb-gcx jb-gcx added the bug The issue is a bug, or the PR is fixing a bug label May 6, 2021
@galak galak added this to the v2.6.0 milestone May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: LWM2M area: Networking bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants