Alternatives to googling Linux log messages? [closed] - linux

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am intermediate Linux user which has basic knowledge of programming (c, perl, js ...) and some system troubleshooting (strace, SystemTap, lsof ...) and I am tired of Googling the messages which comes to Linux logs (/var/log/messages). I would like to improve my Linux kernel knowledge. Since Linux (and it's utilities like ssh etc.) is open source there are source codes available somewhere. So my question is: How can I troubleshoot/debug Linux problems on source code level? Is this even possible for intermediate Linux user? Where to begin and how to improve my programming skills and Linux kernel knowledge this way?

Honestly, Goole will always be your best bet for specific requests.
But if you want theoretical knowledge, read books (or the ebook equivalent that you can find ... on Google). Best of luck.

The Linux kernel cross reference might be helpful. You can browse the source by clicking links.
Try it here (there are other URLs, but I find this one most reliable from my location):
http://lxr.free-electrons.com/

Use a git clone of the Linux source's stable tree.
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Your version will be tagged; run git tag in the directory. Checkout that version, for example git checkout v3.4.45. Then you may run git grep *log message*. You may get no hits, so you can trim the string until you do. For instance, numbers, driver and module names are often in a format string.
Kernel messages will usually have printk, dev_err, BUG, etc. in the source. Often you will be able to tell from lsmod whether a module is present in your system or not. The module names and source files usually match. So you get a clue as to whether the code is present in your system.

Related

Does making software open source make it vulnerable? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
This is more a philosophical question but its one I've been pondering for some time now.
I don't know anything about computer security or how computers are broken into. I thought hackers used disassembling software on executable software to create malware and other things.
My question is would making some software open source make it vulnerable to hackers or do I have reverse engineering confused with hacking?
Making something open source does not inherently make it more vulnerable. Trying to hide what you are doing is known as Security Through Obscurity, and it doesn't work very well.
Making something open source makes things easier for casual hackers, since they can see how your app works more easily. On the other hand, making it open source also lets anyone who is interested look through your code and report security vulnerabilities. They're two sides of the same coin.
For the most advanced threats, they'll get through regardless of whether your code is open source or not. On the other hand, honest volunteers are much less likely to bother trying to find and fix bugs in a closed source product.
So basically, it depends. In general, you're better off open sourcing things if you think people are actually going to be interested in the project.

Which language is suitable for Linux and related programming? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
What would be the best language if I want to develop a range of Linux related things. I want to make kernel patches, Linux programs, contribute with other projects, etc. Where and with which language do I start?
The best way to decide which language is going to be useful to you is to look at the source for the projects to which you wish to contribute. Take a look around popular code repositories, such as github, google-code and sourceforge.
Diving into a language like python may be useful for some scientific projects, but not at all useful for something low-level like linux-kernel development.
I want to make kernel patches
The Linux kernel source tree is currently:
96.5 % c
2.2% assembly
1.3% "other" (documentation and makefiles, presumably).
So start with The C Programming Language and go from there!
Good luck!
You should know C (for kernel patches) and Bash (so you can actually use Linux). Maybe also Python (for general scripting).
If you want to do kernel work and a variety of other Linux core things, then C (followed by C++) would be your starting point. You also need to throw in a healthy does of bash shell programming. And gcc is the compilation tool of choice. The kernel is nearly all C and a lot of apps use C++
Learning Python is a good start, if you are familiar with Object Oriented programming. Shell scripting can help you a lot too.

How to become a linux device driver programmer? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Can any one suggest me how to become a linux device driver programmer.
I have many doubts as I am working as software engineer in a company (1+ yr experience ).Our project is done using C,c++ in linux and windows both,I am working in C,C++ and using Visual studio and Linux GCC for my project.Our project is mainly on remote management of servers and systems.
I am very interested linux kernel-device driver programming .
can any one tell me what is good for me,and how to start I got some books (LDD 3ed ,etc ) but only reading book is sufficient or I have to get some training.
what about this driver programming future and scope.
Kindly tell some suggestion.
Thanks
The LDD O'Reilly book is really good (Rubini et all), Also take a look at the LXR project:
http://lxr.linux.no/
It is a great cross-linked reference of the kernel source. Reading over current driver code is probably the best way to become acquainted.
The best way to learn any language or coding style is to read as much code as you can. Compile it, modify it, crash the kernel, and just play around. Kernel drivers are my personal favorite thing to write, you have a lot of exciting stuff to see!
Good luck!

Are the old days of code injection over? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was wondering since all updated operating systems guard against stack and heap type overflows via ASLR, Canary Checks, and other such methods, are memory corruption exploits still prevalent? Given that the administrator of the system is competent and protects the system from brute force or libc attacks, I honestly can't see many other ways. They only thing that I can possibly imagine for someone to attack a system is to overwrite function pointers on the stack but thats about it. Maybe if someone found a clever way of predicting random numbers, the schemes that rely on random results could be defeated, however it seems unlikely. It seems the only way to exploit someone else's system given now a days is to trick root or the admin into installing your software. Are the old days of code injection over? I'm at this from the perspective of breaking updated protected systems.
You do not need to trick the admin into installing your software if vulnerable software is already installed.
It is much easier to use higher-level constructs to have a OS command injected.
E.g.: a web application allowing to upload a file to arbitrary location, a web application using user-controllable input to build an OS command.

I want to contribute to the Linux kernel [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I want to work with the Linux kernel, but I have no idea where to start. Is there a sort of ticketing system somewhere where bugs and such are distributed? Where can I get ideas for potentially useful contributions?
EDIT: Yes I know what I'm doing. I've been writing my own modifications for a good while now, and I'm doing an independent project under one of the operating systems researchers at my university next semester.
The reason I ask is I'd like to contribute my expertise to the dev process, and I don't know where to start in terms of organization. In terms of technical matters, I'm just about there.
Start with these: Kernel Bugs involving typo.
(Search everyday until you find something promising).
Search that bug database with keywords like "comment", "typo", "documentation", "minor bug", etc.
Also, search under the category Documentation here.
Learn the process first. Then, attempt to contribute something significant.
Pick a subsystem and subscribe to the relevant mailing list. Spend some time studying the subsystem. Start small and fix simple bugs then gradually do work of higher significance. You may want to look at the TODO files in the kernel source directory, especially for drivers in staging.
Get a GIT tutorial. You may also watch this

Resources