| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
While performing the static analysis using the coverity tool found
following memory leak reports
bluez-5.64/mesh/appkey.c:143: leaked_storage: Variable "key" going
out of scope leaks the storage it points to.
Error: RESOURCE_LEAK (CWE-772):
bluez-5.64/mesh/appkey.c:146: leaked_storage: Variable "key" going
out of scope leaks the storage it points to.
|
|
|
|
|
|
|
|
|
| |
This addresses a situation when a boolean type is represented by
an integer and performing a left shift on a boolean causes
an integer overflow.
This fixes the following runtime error:
"left shift of 1 by 31 places cannot be represented in type 'int'"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the following error for invalid read access when registering
filter for incoming messages:
140632==ERROR: AddressSanitizer: stack-buffer-overflow on address...
#0 0x7f60c185741d in MemcmpInterceptorCommon(...
#1 0x7f60c1857af8 in __interceptor_memcmp (/lib64/libasan.so...
#2 0x55a10101536e in find_by_filter mesh/mesh-io-unit.c:494
#3 0x55a1010d8c46 in l_queue_remove_if ell/queue.c:517
#4 0x55a101014ebd in recv_register mesh/mesh-io-unit.c:506
#5 0x55a10102946f in mesh_net_attach mesh/net.c:2885
#6 0x55a101086f64 in send_reply mesh/dbus.c:153
#7 0x55a101124c3d in handle_method_return ell/dbus.c:216
#8 0x55a10112c8ef in message_read_handler ell/dbus.c:276
#9 0x55a1010dae20 in io_callback ell/io.c:120
#10 0x55a1010dff7e in l_main_iterate ell/main.c:478
#11 0x55a1010e06e3 in l_main_run ell/main.c:525
#12 0x55a1010e06e3 in l_main_run ell/main.c:507
#13 0x55a1010e0bfc in l_main_run_with_signal ell/main.c:647
#14 0x55a10100316e in main mesh/main.c:292
#15 0x7f60c0c6855f in __libc_start_call_main (/lib64/libc.so.6+...
#16 0x7f60c0c6860b in __libc_start_main_alias_1 (/lib64/libc.so.6+...
#17 0x55a101003ce4 in _start (/home/istotlan/bluez/mesh/bluetooth-m...
|
| |
|
|
|
|
|
|
|
|
| |
- key_aid refers to application key AID
- net_key_id refers to unique, internal id of the network key, used in
net-keys.h
Also, remove unused mesh_frnd_pkt struct.
|
|
|
|
|
|
|
| |
As pointed out by https://github.com/bluez/bluez/issues/250, the last
segment of a multi-segmented message added to Friend Queue was getting
reset to the seqAuth value incorrectly. The correct sequence was set
within the preceding for loop.
|
|
|
|
|
| |
When invoking mkdir() for mesh configuration storage, do not
report an error if a target directory already exists.
|
|
|
|
|
| |
This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.
|
|
|
|
|
|
|
|
| |
Add implementation for new method ExportKeys() on
org.bluez.mesh.Management1 interface.
This method is used by the authorized application to export information
about network keys, application keys and device keys present in the
local key database.
|
|
|
|
|
|
|
|
| |
According to
https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf
"flooding", "accept list", and "reject list" are the preferred terms.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
|
|
|
|
|
|
| |
This is a minor fix of a memory leak triggered on process exit if
proceess has been killed right after requesting an outbound
advertisement be sent. It is harmless, but will cause an occasional
static analysis failure.
|
|
|
|
|
|
|
|
| |
Certain IOP and stress testing scenarios can cause additional outbound
messages to be attempted before the prior outbound message completes.
This patch adds queuing if outbpund messages are attempted too quickly
so that the additional message is not sent until the prior message is
ACKed.
|
|
|
|
|
|
|
|
|
|
| |
The Mesh profile specification defines a Mesh byte order of Big Endian
for Public keys used to calculate shared secrets. Further the
specification sample data also show this same byte order for Private
keys. However, our internal ECDH shared secret calculation requires
Little Endian byte ordering. This fixes our DBus interface, and
debugging output to use Mesh Byte Ordering (Big Endian) for all human
readable input/output.
|
|
|
|
|
| |
Remove unneeded initialization that prevented the Acceptor roll of ever
recognizing a valid PB-ACK.
|
|
|
|
|
| |
This adds manpage with a brief description of BLuettoth Mesh daemon
command line options.
|
|
|
|
| |
The dir variable needs to be closed before leaving.
|
|
|
|
|
| |
This adds a previously missing entry for "storage" option
when printing the daemon usage info.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This adds a non-interactive test to excercise different datapaths in
bluetooth-meshd. The test cases utilize D-Bus based mesh APIs, e.g.,
to create a new network, import a node, import NetKey, import a remote
node.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a new type of mesh IO that is used for non-interactive testing.
The new io option can be specified on command line as:
--io unit:<socket_name>
When the bluetooth-meshd daemon starts with the "unit" IO type,
the daemon opens a socket (fd to open is provided after "unit:"
in <socket_name>). The communication with the daemon is done either
through the loop-back using mesh DBus-based APIs or the specified
named socket.
|
|
|
|
|
| |
Validate generated and received confirmation data is unique during
provisioning.
|
|
|
|
|
|
| |
This fixes an uninitialized memory issue where a message received for
a local node is silently discarded if an uninitialized boolean is
mistakenly set to TRUE, when friendships exist.
|
|
|
|
|
| |
When validating incoming security material, ensure that the data is
unique to the provisioning session.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes inifinite loop problem caused by recurring call
of the `net_key_beacon_refresh` function.
Problem occurs when at least two nodes are connected to the same
BlueZ instance and they are connected to the same network
(use same network key). Issue is triggered when IVIndex update
process stabilize and one of the nodes receives network beacon
with IVUpdate flag set to 0. Then it processes the "local" beacon
and compose new `snb` (with IVUpdate flag set to 0) attached to
`net_key` instance. After that it calls `net_local_beacon` and
another node processes the new beacon (this node has IVUpdate
flag still set to 1). Note that the `net->ivupdate` has set value 1.
The `update_iv_ivu_state` says that "IVU clear attempted too soon".
The node composes new `snb` with IVUpdate flag set to 1 and writes
it to the `net_key` instance in the `net_key_beacon_refresh`
function. After that it calls `net_local_beacon` which causes
repeat of all process. We are rotating in this loop until end-of-memory.
|
| |
|
|
|
|
| |
No change in functionality, code tightening.
|
|
|
|
|
| |
Validate that the value of Device UUID supplied in
CreateNetwork/Join/Import methods is compliant with RFC 4122.
|
|
|
|
|
|
| |
When a node is created/provisioned/imported, the new node's agent
is removed. The corresponding pointer in the node structure needs
to be set to NULL to avoid pointing to freed memory.
|
|
|
|
|
|
|
|
|
|
| |
At the end of the mesh Key Refresh procedure when a subnet
transitions to Phase 0, local AppKeys that were updated were
not updating until the bluetooth-meshd daemon was restarted.
This patch iterates the AppKeys at the end of mesh Key Refresh
when the subnet transitions to Phase 0, setting the new state
of each updated AppKey.
|
|
|
|
|
|
|
|
| |
Remove check for mkdir() return value, since checking for zero does not
cover "already exists" condition and adding extra check for errno value
unnecessarily complicates the code. If mkdir() fails due to any reason
than "already exists", the subsequent call to open() fails and the
error is detected and corectly processed by the code.
|
|
|
|
|
|
| |
This memsets all the fields of mesh_db_node to zero prior to intializing
some fields in mesh_config_node struct and creating a brand new node
configuration. Just a precaution against having uninitialized items.
|
|
|
|
|
|
|
|
|
|
| |
This fixes a regression introduced in commit c77bb848a9fb
("mesh: Refactor heartbeat pub/sub"):
Heartbeat subscription should be enabled unless either source or
destination are unassigned addresses or period log is zero.
Also, decrement ref count on group destination address if period log
is zero since the subscription is not supposed to be processed.
|
|
|
|
|
|
|
|
| |
When multiple mesh networks are active and one is detached
using Leave(), the I/O to all networks is halted.
This patch prevents that by only deregistering the I/O
if all networks have been detached.
|
|
|
|
|
|
| |
This fixes miscellaneous issues related to unchecked return status
and (temporary) allocated memory leaks due to daemon's exit on startup
failure.
|
|
|
|
|
| |
This fixes a memory leak that may occur on unsuccessful element
initialization from storage.
|
|
|
|
|
|
|
| |
This fixes a potential NULL pointer dereferencing in mesh_model_pub_set()
when virtual address publication cannot be successfully stored.
Also, fix a minor memory leak that may occur on unsuccessful model
initialization from storage.
|
|
|
|
|
| |
This fixes a NULL pointer dereference error (cfgmod-server.c)
and miscellaneous issues related to unchecked return status.
|
|
|
|
|
|
|
| |
When an App is creating or attaching to a node, it first evaluates the
validity of the Apps composition. Invalid compositions are not allowed
to continue. Valid compositions need to be saved, which means that
create_node_config() must be called as part of Composition validation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds SPDX License Identifier and removes the license text.
-------------------------------------
License COUNT
-------------------------------------
LGPL-2.1-or-later : 48
License: LGPL-2.1-or-later
mesh/mesh-mgmt.h
mesh/mesh-mgmt.c
mesh/net-keys.c
mesh/mesh-io-api.h
mesh/mesh.h
mesh/net-keys.h
mesh/model.h
mesh/util.h
mesh/appkey.c
mesh/cfgmod.h
mesh/appkey.h
mesh/prov.h
mesh/prov-acceptor.c
mesh/net.c
mesh/dbus.h
mesh/friend.h
mesh/mesh-io-generic.c
mesh/main.c
mesh/util.c
mesh/dbus.c
mesh/error.h
mesh/mesh-config-json.c
mesh/agent.h
mesh/pb-adv.c
mesh/crypto.c
mesh/crypto.h
mesh/friend.c
mesh/pb-adv.h
mesh/provision.h
mesh/mesh-config.h
mesh/mesh-io-generic.h
mesh/agent.c
mesh/cfgmod-server.c
mesh/mesh-io.h
mesh/keyring.h
mesh/net.h
mesh/keyring.c
mesh/mesh-defs.h
mesh/mesh.c
mesh/rpl.c
mesh/manager.c
mesh/model.c
mesh/mesh-io.c
mesh/node.c
mesh/prov-initiator.c
mesh/rpl.h
mesh/node.h
mesh/manager.h
|
|
|
|
|
|
|
|
|
| |
Change option "config" ('c') to "storage" ('s) to specify
a custom storage directory for node configuration.
Change option 'f' (long name was missing) to "config" ('c')
to specify a custom mesh configuration file to override the
default mesh-main.conf
|
|
|
|
|
| |
In model.c, tx_Start is a static variable, dynamically set, but
never used. Is removed now.
|
|
|
|
|
|
|
|
|
| |
Check whether an incoming message has an RPL entry prior to
handing it over to model layer for processing. If present in RPL
or the RPL queue is full, ignore the incoming message.
If the incoming message is processed successfully, add the message
as a new RPL entry.
|
|
|
|
|
|
|
|
| |
When either a new node is created or an existing node is loaded from
storage, initialize RPL storage directory.
Additionally, when an existing node configguration is read from storage,
load saved RPL entries into the corresponding RPL lists.
|
|
|
|
|
|
| |
Store NetKey and AppKey indices as integers instead of hex strings.
This removes unnecessary string manipulations while not affecting
the configuration file readability.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds processing of "options" dictionary argument in Send,
DevKeySend & Publish methods on mesh.Node interface.
This new argument is a dictionary that currently has only one
new key word defined for Send() and DevKeySend():
"ForceSegmented" - to force small payloads to be sent as
one-segment messages
In case of Publish(), and additional keyword is defined
"Vendor" - 16-bit Company ID as defined by the Bluetooth SIG
Other key words may be defined in future to accommodate evolving
requirements of Mesh Profile specification.
Also, the addition of "options" dictionary to Publish allows to
eliminate VendorPublish() method (taken care by "Vendor" keyword).
|
|
|
|
| |
This prevents error 0x12 when enabling/disabling LE scans
|
|
|
|
|
|
|
| |
Retrieve value of bound Net Key index based on the value of
passed AppKey index. Check if the key is present and fail early
in case of error. Also, pass the correct NetKey index to model
layer in mesh_model_send(), instead of hard coded 0.
|
|
|
|
|
|
| |
This adds previously missing retransmit count and interval values
specific to model publications. The values are configured by Config CLient
and may be different to each model.
|
|
|
|
|
|
| |
The value of net_index in DevKeyMessageReceived() method must be set
to the value of a subnet index on which a device key encoded message
has been received. Was hard coded to 0. Fixed.
|