Skip to contentSkip to conversation

The disappearing sys_call_table export.

DISCUSSION Chuck Ebbert 6 participants 7 messages May 11, 2003 – May 14, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Yoav Weiss

No one specified what audit_log does in this case. Usually, in such modules, the audit function doesn't just log everything. It can, for example, rate-limit the logging and just spit a message about the user DoSing the log system.

Not on the systems I've seen. Max log file size is 4GB and the
logs are on their own partition. If the file fills up the system crashes immediately and only administrators can log in after reboot until the logs are archived.

Quoted 6 lines

The usermode code can change it and
change it back as soon as the file has been unlinked. If the system is under heavy load (generated by the attacker), the attacking process is reniced to 20, and the monitoring part of it has higher priority and keeps stat(2)ing the file, a thread in the attack code may actually be able to change the filename back in time for the second check.

Yes, but now any unsuccessful attempts to change the name will be
logged, where before there was basically no risk for the attacker trying over and over until success. Even a single failure could raise an alert on the target machine, something a cracker definitely does not want to happen.

#1 lore raw
Quoted 4 lines

Not on the systems I've seen. Max log file size is 4GB and the
logs are on their own partition. If the file fills up the system crashes immediately and only administrators can log in after reboot until the logs are archived.

Why would anyone design a system like that ?!
The logging of every security system is prone to flooding. You may have noticed that your syslog sometimes spits "Last message repeated N times" so it won't repeat itself. A system that doesn't deal with this issue in any way can't be secure. There are a lot of methods to deal with it but I think we're going seriously off-topic here so if anyone wishes to continue discussing this specific logging problem, I suggest we switch to non-lkml mode.

Quoted 6 lines

Yes, but now any unsuccessful attempts to change the name will be
logged, where before there was basically no risk for the attacker trying over and over until success. Even a single failure could raise an alert on the target machine, something a cracker definitely does not want to happen.

Not necessarily - it depends on the case. If the file being unlinked is the logfile itself, and its checked by an cron job every once in a while (a common situation), an attacker won't mind making a lot of noise into the soon-to-be-a-free-inode logfile. After-the-fact security systems are usually not suitable for server protection, and the system you suggest, being statistical, is after-the-fact by definition.

Yoav Weiss

#2 lore raw
Quoted 10 lines · Yoav Weiss
Quoted 4 lines

Not on the systems I've seen. Max log file size is 4GB and the
logs are on their own partition. If the file fills up the system crashes immediately and only administrators can log in after reboot until the logs are archived.

Why would anyone design a system like that ?!
The logging of every security system is prone to flooding. You may have noticed that your syslog sometimes spits "Last message repeated N times" so it won't repeat itself. A system that doesn't deal with this issue in any way can't be secure. There are a lot of methods to deal with it but I

Security to some people means that nothing happens unrecorded. Most high security environments treat DoS attacks as the least interesting. You knocked down my military server - who cares. You stole my list of secret command centres - Im deeply upset.

Security requirements are heavily dependant on role and people sometimes forget that. Being down is bad news for an ecommerce site but in many other situations its infinite preferably to most other situations

#3 lore raw
Quoted 4 lines

Security requirements are heavily dependant on role and people sometimes forget that. Being down is bad news for an ecommerce site but in many other situations its infinite preferably to most other situations

This reminds me of a funny story. I was at a meeting to confirm that a
program met some requirements for an agency in Maryland with a three-letter name. After they finally agreed that I had to *see* the requirements before I could assert that the program met them, we came to a requirement that said, roughly, that it must be possible to immediately stop the system from processing any information if they lost, or suspected that they had lost, control over it.

I pointed out to them that any software mechanism I devised for shutting
the system down would require that they had control over the system in order to invoke the mechanism.

They thought about that for a moment and were about to find that the system
did not meet the requirements. I pointed out that anyone could pull the plug or network cable if needed or shut the system down at the switch and that this could be accomplished even if they lost control over the system and would certainly stop it from sending any information. They then agreed that the system met that requirement.

DS

#4 lore raw
Followup to:  <[email protected]>
By author:    "David Schwartz" <[email protected]>
In newsgroup: linux.dev.kernel
Quoted 5 lines

I pointed out to them that any software mechanism I devised for shutting
the system down would require that they had control over the system in order to invoke the mechanism.

Quoted 7 lines

They thought about that for a moment and were about to find that the system
did not meet the requirements. I pointed out that anyone could pull the plug or network cable if needed or shut the system down at the switch and that this could be accomplished even if they lost control over the system and would certainly stop it from sending any information. They then agreed that the system met that requirement.

"Sometimes it's possible to do in hardware what's impossible to do in software." Physical access is a powerful discriminator :)

-hpa

Signature · 3 lines
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
#5 lore raw
In reply to Alan Cox
Quoted 4 lines

Security to some people means that nothing happens unrecorded. Most high security environments treat DoS attacks as the least interesting. You knocked down my military server - who cares. You stole my list of secret command centres - Im deeply upset.

You're right, but panic() is seldom the right solution, even in such case. In most cases, killing the process generating the noise (or all the processes of its uid) is enough and keeps the system more robust. Even if the system runs out of log-space and fails to stop the noise-maker, it can usually take down network interfaces and alert the admin. Still cleaner than crashing. Thats what Cray Unicos does when low on certain resources. It stops the attack while minimizing recovery time. (Rebooting these beasts can be painful). The system stops network traffic while it still has some space left, and panics only if it still runs out of space (unlikely). No audit trail lost and its more graceful.
I'm not saying there is no possible situation where crashing is required, but its rare.

Quoted 5 lines

Security requirements are heavily dependant on role and people sometimes forget that. Being down is bad news for an ecommerce site but in many other situations its infinite preferably to most other situations

Right. Thats why such systems usually come clustered. The panic()ed system stays down until checked, but another system takes its role. Still, military systems have to "think twice" before resorting to crash. Remember that they're usually attacked just as war commences and all hell breaks loose. If your defense systems are too easy to DoS, you can't rely on them and their secrecy won't help you. In such cases an unreliable system can be worse than no system at all. If allies could DoS the Enigma and force the Nazis to use their fallback system (which was kinda lame), they wouldn't have to spend resources on cracking the Enigma.

#6 lore raw
In reply to Chuck Ebbert
Quoted 11 lines · Chuck Ebbert
Quoted 4 lines · Yoav Weiss

No one specified what audit_log does in this case. Usually, in such modules, the audit function doesn't just log everything. It can, for example, rate-limit the logging and just spit a message about the user DoSing the log system.

Not on the systems I've seen. Max log file size is 4GB and the
logs are on their own partition. If the file fills up the system crashes immediately and only administrators can log in after reboot until the logs are archived.

In a production system various things happen (no particular order):

-- The audit log functionality allows synchrnous or asynchrnous logging, as driven by security policy. This would mostly be asynch (think how klog works)

-- The audit log probably does not go to a local disk but to a log server.

-- The system allows for more finely controlled auditing and gives the security admin the ability to observe a particular system call for a particular user, under particular circumstances. (Audit a failed system call or a successful system call). In case of unlink, it's probably more useful to observe a system call that does a ret=0 than ret=-Exxx.

-- Really what we are interested in auditing are untrusted users, who should be given a limited access to begin with.

In addition, because it provides allow/deny control ability on a per-uid per-syscall basis, we can simply deny unlink to any thing which is rogue and not audit it's success or failure. :^) . It WILL fail with an -EPERM, so why audit it permanently? (One can audit it for a brief period to create an evidence trail and then turn the audit tap off).

The system I am talking about already allows for all of the above. The only problem was the issue of defeating accurate due to potential multiple copy_from_user calls ... Which has been addressed rather nicely thanks to you all (my thanks to Arjan for pointing out the issue and to Yoav and Terje for giving solution hints).

Cheers,

Ahmed.