From: Wei Liu <wei.liu2@citrix.com>
To: George Dunlap <george.dunlap@citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: XSA-180 follow-up: repurpose xenconsoled for logging
Date: Tue, 7 Jun 2016 11:18:39 +0100 [thread overview]
Message-ID: <20160607101839.GF25922@citrix.com> (raw)
In-Reply-To: <57569A7A.9090703@citrix.com>
On Tue, Jun 07, 2016 at 10:57:14AM +0100, George Dunlap wrote:
> On 06/06/16 16:48, Wei Liu wrote:
> >> A distro which isn't equipped to deal with these things is of no
> >> practical use in the real world.
> >>
> >> Any distro we care about supporting is equipped to deal with logs.
> >>
> >>>
> >>> I agree that if logging using existing logging systems were workable,
> >>> that would be a better solution. Wei did actually spend a decent chunk
> >>> of time looking at other options, including logrotate and journald
> >>> before settling on using xenconsoled.
> >>>
> >>> A lot of this brainstorming and discussion happened off-list because
> >>> XSA-180 was still embargoed, so I can understand why it looks like this
> >>> came out of nowhere. It would probably be good for Wei to report here
> >>> what he found and why he decided to propose this solution instead.
> >>
> >> Please do. Until there is an understanding of why the standard
> >> mechanisms are not suitable, it is premature and naive to re-invent a wheel.
> >>
> >
> > With syslog and logrotate you will still end up filling up your disk.
> > Logrotate can't actively rotate log files.
>
> FWIW CentOS 6 and 7 (which use rsyslogd and systemd-journald
> respectively) seem to have rate-limiting stuff enabled by default; the
> attached program causes a lot of CPU utilization, but no disk resource
> exhaustion.
>
Not rate-limited on Debian Jessie installation. We can make
recommendation that system administrators should rate-limit syslog.
But CPU utilisation is also bad, just a different kind of "bad" from
disk exhaustion.
> > You can't just tap syslog to QEMU at the moment unless you use the
> > script I sent to XSA-180 security@ discussion. That's still a hacked up
> > solution.
> >
> > I actually don't mind having syslog deal with those, but we need to
> > provide some not-so-hacked-up way for doing it.
>
> On Linux, it looks like you can create a socket and "connect" to /dev/log.
>
That's the standard interface to syslog. I believe that's what openlog()
and syslog() use. We can open a socket and write to that, but you won't
get what you want without providing the correct formated message.
Try with:
sudo socat /dev/log STDIN
Wei.
> -George
>
> #include <syslog.h>
> #include <time.h>
>
> int main(int argc, char * argv[]) {
> int rc;
>
> struct timespec tv = { .tv_nsec = 5000 };
>
> openlog("DoS Attempt", 0, LOG_DAEMON);
>
> while(!(rc = nanosleep(&tv, NULL))) {
> syslog(LOG_ERR, "This is a nasty attempt to DoS syslog\n");
> }
>
> if(rc) {
> perror("nanosleep");
> }
> }
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-06-07 10:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 14:00 XSA-180 follow-up: repurpose xenconsoled for logging Wei Liu
2016-06-03 10:57 ` George Dunlap
2016-06-03 13:30 ` Wei Liu
2016-06-03 14:10 ` George Dunlap
2016-06-03 14:21 ` Wei Liu
2016-06-03 16:57 ` Ian Jackson
2016-06-06 15:56 ` Wei Liu
2016-06-03 17:38 ` Andrew Cooper
2016-06-06 10:12 ` George Dunlap
2016-06-06 13:03 ` Andrew Cooper
2016-06-06 15:48 ` Wei Liu
2016-06-07 9:57 ` George Dunlap
2016-06-07 10:18 ` Wei Liu [this message]
2016-06-06 20:47 ` Doug Goldstein
2016-06-07 11:43 ` Wei Liu
2016-06-21 14:46 ` Wei Liu
2016-06-21 15:10 ` Juergen Gross
2016-06-21 15:23 ` Ian Jackson
2016-06-21 15:11 ` Ian Jackson
2016-06-21 15:53 ` George Dunlap
2016-06-21 16:04 ` Ian Jackson
2016-06-21 16:17 ` George Dunlap
2016-06-22 0:58 ` Jim Fehlig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160607101839.GF25922@citrix.com \
--to=wei.liu2@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.