Project

General

Profile

Actions

Bug #16118

closed

Fix problems with libnwam communication between 32-bit and 64-bit applications

Added by Carsten Grzemba 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

The 64-bit nwam-manager application using the libnwam can not communicate with the 32-bit nwamd.

There are two kinds of communication between nwamd and nwam-manager. The first is doorfs communication. This is broken because the data structure exchanged in the 64-bit libnwam has additional paddings for enforce the 64-bit alignment. But for communication with the 32-bit nwamd this 8 byte paddings have to be removed so that the data structures are the same in 32-bit and 64-bit.

The second communication is a messages queue communication msgsnd - msgrcv. For send messages the data structure is used:

typedef struct nwam_event *nwam_event_t;
struct nwam_event {
        int nwe_type;
        uint32_t nwe_size;

        union {
...
        } nwe_data
}

In msgsnd (2) is noted that the first parameter long have to use for msg_type, but nwam_event_t uses int for msg_type. On passing messages in the kernel and back to the receiver the expected long data type will be adapted to the data size of the calling process. This leads to misalignment of the whole message data.


Related issues

Blocks illumos gate - Bug #16115: Want 64-bit libnwamClosedMarcel Telka

Actions
Actions #1

Updated by Electric Monk 6 months ago

  • Gerrit CR set to 3188
Actions #2

Updated by Joshua M. Clulow 6 months ago

  • Parent task deleted (#16115)
Actions #3

Updated by Joshua M. Clulow 6 months ago

Actions #4

Updated by Carsten Grzemba 5 months ago

For test the patch in 32-bit I used 'nwamadm'

For test the patch in 64-bit I used 'nwam-manager' and see the results in Mate panel and in nwam-manager-properties

Actions #5

Updated by Electric Monk 5 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 578978f135d3d5007cd4590ec41afed45e52044b

commit  578978f135d3d5007cd4590ec41afed45e52044b
Author: Carsten Grzemba <cgrzemba@opencsw.org>
Date:   2024-01-23T21:19:48.000Z

    16118 Fix problems with libnwam communication between 32-bit and 64-bit applications
    Reviewed by: Marcel Telka <marcel@telka.sk>
    Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
    Approved by: Dan McDonald <danmcd@mnx.io>

Actions

Also available in: Atom PDF