LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-30-2023, 09:18 AM   #1
pintomonde
LQ Newbie
 
Registered: Sep 2023
Posts: 7

Rep: Reputation: 0
Tweaking and recompiling the code of a WiFi driver for my needs


I want to take an existing, standard WiFi driver for Linux and tweak it. I'll inroduce a whitelist into it. That is, to the consumer a driver will show the networks from a whitelist only ignoring all other ones.



It's a PoC. I want to implement it as simply as possible.

Can this be implemented? And how, in a high level?


---

It must be a driver, not a user-space application, because it's a requirement.

A driver, as I've been suggested, is iwlwifi, which is a part of the kernel

https://git.kernel.org/pub/scm/linux...ireless/scan.c

Right?

Last edited by pintomonde; 09-30-2023 at 01:37 PM.
 
Old 10-01-2023, 11:45 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,309

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Hello, pintomonde & welcome to LQ.

What you suggest is like trying to put a map of one way streets into you car's engine. The WiFi driver just drives the wifi card. There's a whole networking stack that handles routing and IP packets. The job you are describing is a firewall, and you already have one.

These days, firewalls are problematic because spare IPV4 address blocks assigned to one country have been sold and assigned in another. Also, once hackers compromise one apparently innocent box, they can launch attacks from there. But your firewall will let it through. Everyone updated the Solar Winds software a year or two back - which came with a virus attached.

Try seeing if iptables does what you want to do with your wifi driver.
 
1 members found this post helpful.
Old 10-01-2023, 01:27 PM   #3
pintomonde
LQ Newbie
 
Registered: Sep 2023
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by business_kid View Post
Hello, pintomonde & welcome to LQ.

What you suggest is like trying to put a map of one way streets into you car's engine. The WiFi driver just drives the wifi card.
You haven't undertood.

....a wifi driver drives by a) looking for WiFi networks b) finding them c) creating a list of them d) giving a list of them to the consumer - Linux user level. Correct?

I want to create a modified version of a Wifi driver which would post-process some data in the (c) step thus cutting off some of them the networks off a list, right before passing it to the user level.

That is, it'd simply give out a slightly modified list of the networks

You claim that this wouldn't be possible?

Last edited by pintomonde; 10-01-2023 at 06:02 PM.
 
Old 10-02-2023, 05:36 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,309

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
I don't think so. The wifi driver simply passes network traffic in the form of network packets to the particular wifi card you have. If you swapped your wifi card, you'd need another network driver. Connecting to networks is hardly relevant, as if you could get onto other local networks you'd hardly pay your isp, would you?

There are a host of programs including the kernel involved in deciding what goes into network packets. The wifi driver doesn't decide anything. This is not my strong suit, but I'm sure others will chip in. I imagine running a firewall to exclude social media might be an option but I'm sure it's not a simple task.

The last thing you need is a tweaked wifi driver.
 
1 members found this post helpful.
Old 10-02-2023, 09:52 AM   #5
pintomonde
LQ Newbie
 
Registered: Sep 2023
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by business_kid View Post
There are a host of programs including the kernel involved in deciding what goes into network packets. The wifi driver doesn't decide anything. This is not my strong suit, but I'm sure others will chip in. I imagine running a firewall to exclude social media might be an option but I'm sure it's not a simple task.

The last thing you need is a tweaked wifi driver.
>>I imagine running a firewall to exclude social media

I'm asking him about Wifi networks, twice already, but he's still telling me about social media - websites - and firewall. What a strange developer.


>>The last thing you need is a tweaked wifi driver.

How do you know what I need to?

Last edited by pintomonde; 10-02-2023 at 09:54 AM.
 
Old 10-02-2023, 10:09 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by pintomonde View Post
>>I imagine running a firewall to exclude social media
I'm asking him about Wifi networks, twice already, but he's still telling me about social media - websites - and firewall. What a strange developer.
It seems like you're not understanding/liking the answer, despite it being correct. The Wifi driver does one thing: enables the device to talk to things further into the system. This include things like the security pieces (WPA, etc.), along with the rest of the TCP/IP stack. That's it. The list of wifi networks *IS NOT* coming from the wifi driver. And how do you propose to introduce this 'whitelist' into things??? Do you expect people to recompile the network driver each time they travel so they can use a different network?? Or do you plan on using something else...which then takes your driver into user-space, doesn't it???

What's strange is you asking this question; if you're able to modify kernel level drivers, you'd already know these things. If you're unable to do so, why are you doubting what others tell you?? If you can do, please proceed and prove everyone wrong. Feel free to look into any wifi driver module to see how things work, then think about how they do what they do.
Quote:
>>The last thing you need is a tweaked wifi driver.
How do you know what I need to?
Monkeying around with a wifi driver makes things far less secure and stable, which is something that pretty much no one needs.
 
Old 10-02-2023, 01:48 PM   #7
pintomonde
LQ Newbie
 
Registered: Sep 2023
Posts: 7

Original Poster
Rep: Reputation: 0
>The list of wifi networks *IS NOT* coming from the wifi driver.

Where does come from then? What is it that builds it?


>Do you expect people to recompile the network driver each time they travel so they can use a different network??

Re-read my question. I'm asking about the implementation only. Of a driver.

You don't need to try to guess a reason or whether it'd all be feasiable, or what to do instead of it. Stupidity.

Last edited by pintomonde; 10-02-2023 at 02:01 PM.
 
Old 10-02-2023, 01:58 PM   #8
pintomonde
LQ Newbie
 
Registered: Sep 2023
Posts: 7

Original Poster
Rep: Reputation: 0
Now tell me

https://git.kernel.org/pub/scm/linux...ireless/scan.c


If you claim that Wifi driver doesn't build a list of Wifi networks itself, what are bssid and ssid there for?
 
Old 10-02-2023, 02:01 PM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by pintomonde View Post
>The list of wifi networks *IS NOT* coming from the wifi driver.
Where does come from then? What is it that builds it?
Things that aren't in the wifi driver, but further up, as you've been told.
Quote:
>Do you expect people to recompile the network driver each time they travel so they can use a different network??
Re-read my question. You don't and can't know requirements, therefore you're making bizzare guesses. I'm asking about the implementation only. What you're doing though is guessing a reason and whethere it'd be feasiable. Stupidity.
Right, we can't and don't know the requirements, because *YOU HAVE NOT TOLD US WHAT THEY ARE* You keep saying it's a 'requirement', but don't say for what, what purpose, etc. You call people 'strange', tell them they're stupid, yet somehow expect us to give you help. What you're wanting is *NOT* feasible, as you've been told, but again...don't seem to want that answer.

Get any wifi driver you want and look at the source code. Look at the code/github for nmcli and you may find some other things, such as:
Quote:
Originally Posted by NMCLI Docs
The NetworkManager daemon runs as a privileged service (since it must access and control hardware), but provides a D-Bus interface on the system bus to allow for fine-grained control of networking. NetworkManager does not store connections or settings, it is only the mechanism by which those connections are selected and activated.

To store pre-defined network connections, two separate services, the "system settings service" and the "user settings service" store connection information and provide these to NetworkManager, also via D-Bus. Each settings service can determine how and where it persistently stores the connection information; for example, the GNOME applet stores its configuration in GConf, and the system settings service stores it's config in distro-specific formats, or in a distro- agnostic format, depending on user/administrator preference.
Good luck; you'll need it.
 
Old 10-02-2023, 02:16 PM   #10
pintomonde
LQ Newbie
 
Registered: Sep 2023
Posts: 7

Original Poster
Rep: Reputation: 0
What does this function do, for instance?

https://git.kernel.org/pub/scm/linux...ss/scan.c#n583

A list of access points. Interesting, isn't it?

What does it do there then if a list of them isn't generated by a Wifi driver?

Last edited by pintomonde; 10-02-2023 at 04:31 PM.
 
Old 10-03-2023, 07:04 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,309

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Look, all these things are done very well by the gnu utilities and the linux kernel.

This wifi driver thing has got way out of proportion. To block out social media requires analysing the packets, which a wifi driver doesn't do. It can be done by DNS. A good move may be to check opendns.org and see if they have an option to block social media. Even if they don't, there's clever tricks and hacks that your kids will find out about before you.

I ran on the censored version of opendns while my kids were teenagers. But they were not fools. If they wanted porn, all they had to do was go to a torrent site! Fortunately, they didn't want it.
Quote:
Originally Posted by John Perry Barlow
The Internet treats censorship as a malfunction and routes around it
As for your kernel.org link - The kernel knows more about me than I know about it .
 
Old 10-03-2023, 08:54 AM   #12
pintomonde
LQ Newbie
 
Registered: Sep 2023
Posts: 7

Original Poster
Rep: Reputation: 0
He keeps giving me an advice about what HE THINKS I need. Rather than what I've asked about multiple times. Is he a lunatic or not?

A bunch of stuborn creakers

Last edited by pintomonde; 10-03-2023 at 09:01 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
network-manager-applet needs recompiling for -current Lockywolf Slackware 2 06-04-2018 08:04 AM
CentOS Display Problems, your display needs tweaking, here you go, no xrandr needed.. damiank Linux - Desktop 0 08-09-2012 02:14 AM
was recompiling 2.6.17 to fit my needs and messed it up. agentc0re Slackware 6 04-15-2007 04:31 PM
LXer: Nvidia posts graphics code tweaking tool LXer Syndicated Linux News 0 10-20-2006 07:33 PM
network needs tweaking? moose_grunt Linux - Networking 1 08-28-2004 12:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration