Project

General

Profile

Actions

Issue #2311

open

Handle endianness in multi bytes fields in libsamsung-ipc

Added by Denis 'GNUtoo' Carikli over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Telephony and mobile data
Target version:
Start date:
02/11/2022
Due date:
% Done:

0%

Estimated time:
Resolution:
Device:
Galaxy S 3 (I9300)
Grant:
Type of work:
C programming, User testing
Actions #1

Updated by Denis 'GNUtoo' Carikli over 2 years ago

In the following struct, we have length that is little endian. we should use ht

struct ipc_fmt_header {
    unsigned short length;
    unsigned char mseq;
    unsigned char aseq;
    unsigned char group;
    unsigned char index;
    unsigned char type;
} __attribute__((__packed__));

Since the information from that struct is used to construct another struct, we could use some functions like ntohl but for little endian to host instead.

I'm not sure if there are other places in the code where there is this issue though.

Actions #2

Updated by Denis 'GNUtoo' Carikli over 2 years ago

  • Target version changed from Any Replicant version with an upstream kernel to libsamsung-ipc 1.0

It's not that urgent: it'd probably become an issue when it starts becoming packaged in GNU/Linux distributions.

Actions

Also available in: Atom PDF