Score:0

Ubuntu 22.04 - kernel module can not get address of printk

va flag

I'm compiling a legacy kernel driver on Ubuntu 22.04, kernel 5.15.0-56-generic

  1. The driver provides IOCTL where user process can set the address of kernel exported function using system.map file.

  2. To this user process provided address, driver internally adds the address of printk to get the actual address of the kernel function. (as the addresses in system.map are relative to printk)

    required_function_addr = (user_provided_addr + printk);

Now we want to compile the driver for ubuntu 22.04 and get below error:

error: ‘printk’ undeclared (first use in this function); did you mean ‘_printk’?

Is there a way to fix this?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.