Questions tagged [netlink]

Netlink is a socket based inter process communication protocol for Linux systems. It is currently the preferred way, as of 2.6, of communicating with user space from the kernel.

337 questions
0
votes
0 answers

Stuck with netlink, connektor, socket and co

I'm completely new to netlink & co. and I am trying to establisch a connection from user space to the w1-kernel module of a raspberry pi. Unfortunately the documentation i found is spotty and contradictory. Here some of the things not clear to…
0
votes
0 answers

SK_RMEM_ALLOC Defintion

I am doing research on CVE-2017-16939 and trying to understand the exploit code for an assignment; however, I cannot find clear information on what sk_rmem_alloc represents. Can someone point me in the direction of documentation that answers these…
Katya
  • 83
  • 7
0
votes
1 answer

non-blocking socket vs. select() driven approach

I'm writing user-space application which among other functionality uses netlink sockets to talk to the kernel. I use simple API provided by open source library libmnl. My application sets certain options over netlink as well as it subscribes to…
Mark
  • 6,052
  • 8
  • 61
  • 129
0
votes
1 answer

Why isn't the Kernel receveing my generic netlink messages?

I'm trying to send nested attributes from user space to kernel using generic netlink, the function nl_send_auto() returns 52 (which was supposed to be the numbers of bytes sent to kernel) but the kernel isn't receiving the messages. Is there some…
Matheus
  • 195
  • 1
  • 1
  • 11
0
votes
1 answer

How to send multipart messages using libnl and generic netlink?

I'm trying to send a relatively big string (6Kb) through libnl and generic netlink, however, I'm receiving the error -5 (NL_ENOMEM) from the function nla_put_string in this process. I've made a lot of research but I didn't find any information about…
Matheus
  • 195
  • 1
  • 1
  • 11
0
votes
2 answers

mathematica and matlab interaction with NetLink and data exchange between them

I used the following code in mathematica to call matlab In[1]:= Needs["NETLink`"] matlab = CreateCOMObject["matlab.application"] In[5]:= matlab@Execute["a=[1 2;3 4]"] I want to get matlab workspace variable "a" from mathematica and convert it…
Jalil
  • 221
  • 2
  • 8
0
votes
0 answers

Embedded C in SystemTap - dereferencing pointer to incomplete type

I am following this tutorial: https://blog.lexfo.fr/cve-2017-11176-linux-kernel-exploitation-part1.html As I try to see what the netlink_sock contains in state, I use this embedded C code: %{ #include #include…
0
votes
0 answers

recvmsg in blocking mode still works after fd is invalid

I have a simple program with two threads. One thread listens to some user input and another listens for interface changes using a NETLINK socket. The socket is setup like so: netlink_fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); struct…
incubus
  • 681
  • 1
  • 5
  • 21
0
votes
1 answer

How to send and receive a struct through netlink?

I'm trying to send a struct from user-space to my module in kernel space using netlink, my struct in the user-space is: struct test{ unsigned int length; char name[MAX_NAME_LENGTH]; }; and in the kernel space is: struct test{ __u32 length; …
Matheus
  • 195
  • 1
  • 1
  • 11
0
votes
1 answer

Use netlink to get inode from socket on older kernel

I wrote a piece of code to get a list of sockets and their inodes using sock_diag netlink. Here is the send code: struct { nlmsghdr nlh; inet_diag_req_v2 id_req; } req = { .nlh = { .nlmsg_len = sizeof(req), .nlmsg_type =…
incubus
  • 681
  • 1
  • 5
  • 21
0
votes
0 answers

The maximum buffer size that we can pass using netlink and PAGE_SIZE influence on it

I am working on an application (ARM platform) that uses netlink messages to pass a buffer of size 8k to kernel space driver to fetch some data from the driver. I have allocated the required memory for the nl message using function…
0
votes
0 answers

Docker and kubernetes capabilities

i have a question and a problem about capabilities. Why my program work when i run docker run --cap-add=NET_ADMIN... ? ( i don't have RTNETLINK problems and TC Network problems with ETH0) And it's doesn't work if i run my program with file .yml…
Julie
  • 139
  • 1
  • 1
  • 4
0
votes
1 answer

How to use libnl and netlink socket for connect devices to AP programatically?

I'm creating a C library that manages a lot of peripherical of my embedded device. The S.O. used, is a Linux distro compiled with yocto. I'm trying to make some functions to connect my device to wifi (well-know) router, with netlink (using the libnl…
kwroot
  • 47
  • 2
  • 7
0
votes
1 answer

How to connect my device to wifi with libnl?

I'm creating a C library that manage a lot of pheripherical of my embedded device. The S.O. used, is a linux dristro compiled with yocto. I'm trying to make some functions to connect my device to a wifi (well-know) router, with netlink (using the…
Sguit
  • 35
  • 1
  • 8
0
votes
0 answers

IPSec on Linux with strongSwan: received netlink error: No such file or directory (2)

I have set up an IPSec system on two hosts with the following basic information: - Linux kernel: 4.4.135 - IKE: strongSwan 5.6.1 LAN1 --->| WAN1: 192.168.100.121 | <---->| WAN2: 192.168.100.122 | <---- LAN2 I am testing a new block algorithm named…
Samwell Ho
  • 59
  • 1
  • 5