Skip to contentSkip to conversation

monitor: Only print credentials if PID is set

PATCH Applied Luiz Augusto von Dentz 3 participants 4 messages Jun 1, 2023 – Jun 2, 2023 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/2 monitor: Only print credentials if PID is set

From: Luiz Augusto von Dentz <[email protected]>

If PID is not set don't print anything since this is likely a packet originated by the kernel itself.

---
 monitor/packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
monitor/packet.c +1 -1
index 946ceb2c640d..6d73e5abfcbc 100644
@@ -438,7 +438,7 @@ static void print_packet(struct timeval *tv, struct ucred *cred, char ident,
 			pos += n;
 	}
 
-	if (cred) {
+	if (cred && cred->pid) {
 		cred_pid(cred, pid_str, sizeof(pid_str));
 		n = sprintf(line + pos, "%s: %c %s", pid_str, ident,
 						label ? label : "");
Signature · 1 line
2.40.1
author maintainer
#1 lore raw

PATCH 2/2 shared/bap: Don't overwrite attribute declaration

From: Luiz Augusto von Dentz <[email protected]>

The attribute declaration (e.g. characteristic properties) shall not be overwritten as they are part of the information that is part of the cache beside the same information is already stored as part of the bt_bap instance.

---
 src/shared/bap.c | 12 ------------
 1 file changed, 12 deletions(-)
src/shared/bap.c +0 -12
index 26f41be768e9..86c2634472fb 100644
@@ -3077,9 +3077,6 @@ static void read_source_pac_loc(bool success, uint8_t att_ecode,
 
 	pacs->source_loc_value = get_le32(value);
 
-	gatt_db_attribute_write(pacs->source_loc, 0, value, length, 0, NULL,
-							NULL, NULL);
-
 	/* Resume reading sinks if supported but for some reason is empty */
 	if (pacs->source && queue_isempty(bap->rdb->sources)) {
 		uint16_t value_handle;
@@ -3113,9 +3110,6 @@ static void read_sink_pac_loc(bool success, uint8_t att_ecode,
 
 	pacs->sink_loc_value = get_le32(value);
 
-	gatt_db_attribute_write(pacs->sink_loc, 0, value, length, 0, NULL,
-							NULL, NULL);
-
 	/* Resume reading sinks if supported but for some reason is empty */
 	if (pacs->sink && queue_isempty(bap->rdb->sinks)) {
 		uint16_t value_handle;
@@ -3149,9 +3143,6 @@ static void read_pac_context(bool success, uint8_t att_ecode,
 
 	pacs->sink_context_value = le16_to_cpu(ctx->snk);
 	pacs->source_context_value = le16_to_cpu(ctx->src);
-
-	gatt_db_attribute_write(pacs->context, 0, value, length, 0, NULL,
-							NULL, NULL);
 }
 
 static void read_pac_supported_context(bool success, uint8_t att_ecode,
@@ -3175,9 +3166,6 @@ static void read_pac_supported_context(bool success, uint8_t att_ecode,
 
 	pacs->supported_sink_context_value = le16_to_cpu(ctx->snk);
 	pacs->supported_source_context_value = le16_to_cpu(ctx->src);
-
-	gatt_db_attribute_write(pacs->supported_context, 0, value, length, 0,
-							NULL, NULL, NULL);
 }
 
 static void foreach_pacs_char(struct gatt_db_attribute *attr, void *user_data)
Signature · 1 line
2.40.1
#2 lore raw
In reply to Luiz Augusto von Dentz

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=753319

---Test result---

Test Summary:

CheckPatch                    PASS      1.05 seconds
GitLint                       PASS      0.74 seconds
BuildEll                      PASS      27.23 seconds
BluezMake                     PASS      889.25 seconds
MakeCheck                     PASS      12.26 seconds
MakeDistcheck                 PASS      155.68 seconds
CheckValgrind                 PASS      252.09 seconds
CheckSmatch                   WARNING   341.89 seconds
bluezmakeextell               PASS      103.28 seconds
IncrementalBuild              PASS      1456.56 seconds
ScanBuild                     PASS      1036.99 seconds

Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
monitor/packet.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.monitor/packet.c:1832:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:3552:52: warning: array of flexible structuresmonitor/bt.h:3540:40: warning: array of flexible structures

---
Regards,
Linux Bluetooth

#3 lore raw
In reply to Luiz Augusto von Dentz
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 7 lines · On Thu, 1 Jun 2023 16:33:16 -0700 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

If PID is not set don't print anything since this is likely a packet originated by the kernel itself.

---
 monitor/packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [BlueZ,1/2] monitor: Only print credentials if PID is set

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f84979c1591f
  - [BlueZ,2/2] shared/bap: Don't overwrite attribute declaration
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=52477e80fc89

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html