Monthly Archive for October, 2009

Will Backman: bsdtalk178 – Richard Clayton – Evil on the Internet – EuroBSDCon

A recording from EuroBSDCon 2009: Richard Clayton - Evil on the Internet.
A perfect topic for Halloween. This talk covers phishing, mule recruitment, fake escrow, fake pharmacies, fake banks, ponzi schemes, link spammers, etc. Scary stuff.

File info: 1h 9min, 33MB.

Ogg Link:
http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk178.ogg

Erwin Lansing: Regressions in FreeBSD 9.0

Even though 8.0 hasn’t been released yet, with the second release candidate available for testing, a number of regressions have already been committed to HEAD, or FreeBSD 9.0-CURRENT. The single change that caused most fallout in ports was a commit to the sh(1) parser that disallows mismatched quotes in backticks that broke a large number of badly written ‘configure’ scripts. A number of those have already been fixed, but there are still plenty of errors out there. The fix is usually easy, like the one for tcl83, so if you’re looking for something to do while the ports tree is still in a slush state, please give a hand by fixing some of the new errors on 9.0. For a full list, see the logs of the pointyhat cluster.

Related posts:

  1. Ports feature freeze now enforced As an experiment, there will not be a complete ports...

Related posts brought to you by Yet Another Related Posts Plugin.

Remko Lodder: FreeBSD-8.0 RC2 released

A few days ago the FreeBSD team released RC2 of the 8.0 version. This is the fore-last before 8.0-RELEASE will see the light. Some problems had been ironed out, especially that had fallout of the NULL mapping removal option. PIE was one of the things that broke, things like Samba seemed to be affected.

This had been resolved now, and everyone is advised to test -RC2. -RC3 will also follow in around two weeks from now, closing in on the -RELEASE version. Stay tuned!

p.s. I am also writing a “Welcome to FreeBSD 8″ article. This is currently being reviewed by my employer (which supported me in writing this) and will be published soon..

FreeBSD News Flash: New committer: Sylvio Cesar Teixeira (ports)

FreeBSD News Flash: FreeBSD 8.0-RC2 Available

The second of the Release Candidates for the FreeBSD-8.0 release cycle is now available. ISO images for Tier-1 architectures and a memory stick image for amd64/i386 are now available on most of the FreeBSD mirror sites.

Upcoming FreeBSD Events: BSDCan 2013

BSDCan 2013 (http://www.bsdcan.org/), University of Ottawa, Ottawa, Canada 13 - 17 May, 2013. BSDCan is a developers conference with a strong focus on emerging technologies, research projects, and works in progress. It also features Userland infrastructure projects and invites contributions from both free software developers and those from commercial vendors.

FreeBSD Foundation: Another New Funded Project

Rafal Jaworowski and Semihalf have been awarded a grant to provide FreeBSD with support for the flattened device tree (FDT) technology. This project allows for describing hardware resources of a computer system and their dependencies in a platform-neutral and portable way.

The main consumers of this functionality are embedded systems whose hardware resources assignment cannot be probed or self-discovered.

The FDT idea is inherited from Open Firmware IEEE 1275 device-tree notion (part of the regular Open Firmware implementation), and among other deployments is used as a basis for Power.org's embedded platform reference specification (ePAPR).

"Thanks to this project, embedded FreeBSD platforms will grow in a uniform and extensible way of representing hardware devices, compliant with industry standards (ePAPR, Open Firmware), independent of architecture and platform (portable across ARM, MIPS, PowerPC etc.)," said Rafal Jaworowski, FreeBSD Developer.

Semihalf is a privately owned company, based in Krakow, Poland. They specialize in embedded systems design and development, with expertise in both software and hardware. Among their portfolio are FreeBSD ports to high-end embedded processors (including multi-core) with a wide range of peripheral drivers (storage, networking, pattern matching, security engines etc.); most of this work is publicly available from the FreeBSD repository.

This project will complete by February 2010.

Philip Paeps: Fixing strange DHCP behaviour

Someone -- I thought it was Kristof, but he claims not to have this problem so it must be someone else -- told me a while ago that Telenet's DHCP server "exhibits weird behaviour". That sort of mystery certainly gets the hyperactive mind interested.

For totally unrelated reasons, I found myself looking at a packet capture of DHCP traffic on a Telenet connection. Indeed, there was something very strange in there. The DHCP client would get a perfectly fine lease with perfectly reasonably renewing and rebinding times. When the renewing timer (T1) expired, the client would unicast a DHCPREQEST to the server and expect a unicast DHCPACK back. Only the DHCPACK would never arrive, and the client would retransmit the unicast DHCPREQUEST messages until the rebinding timer (T2) expired. At that time, the client would broadcast a DHCPREQUEST after which the DHCPACK would arrive.

The fact that the DHCPACK messages came through the DHCP relay server put me on a side-track briefly. I discovered that the DHCP server (mentioned in option 54) would not respond to my DHCP requests. While it makes perfect sense to protect a DHCP server from clients, you do want your clients to be able to get packets to them somehow.

I sent some packet captures to a contact inside Telenet (thanks ;-) I couldn't imagine trying to explain this to a helldesk!) wondering if they'd put too sharp an access control list between me and the DHCP server (recently -- because I hadn't seen the problem before). After some digging, they found that I was sending my unicast DHCPREQUEST messages with a random source port number. From my reading of the RFC, this is "allowed", but no one else does it. It turns out that Telenet does some sanity checking (sensible precaution) on DHCP messages before allowing them to go to the DHCP server. This sanity checking does not like (or recognize, presumably) DHCP messages with a source port other than bootpc (68).

FreeBSD's dhclient is a rather old version of ISC's reference implementation, simplified by OpenBSD. I found that OpenBSD has had a patch for a couple of years that purported to fix this behaviour. When I ported this patch to FreeBSD however, I found that sendmsg would return EINVAL, which was not documented to ever happen.

Again I wondered how people without source code to their operating systems get through the day? Do they resort to alcohol and panic at this stage? I used DDB to set a breakpoint on sendmsg and stepped through briefly, expecting it to blow up somewhere quickly when copying in the iovec or so. No such luck however, and I found myself in sosend_generic, which is not so much fun to step through without symbol information, so I set up remote debugging so I could use ddd.

Eventually, I found my way to rip_output and found that my EINVAL came from here:

if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options)
    || (ip->ip_len > m->m_pkthdr.len)
    || (ip->ip_len < (ip->ip_hl << 2))) {
        INP_RUNLOCK(inp);
        m_freem(m);
        return (EINVAL);
}

Oh dear...:

(gdb) p m->M_dat.MH.MH_pkthdr.len
$6 = 328
(gdb) p ip->ip_len
$7 = 18433

Obviously (to the trained -- or strained -- eye which sees this kind of thing often), 18433 and 328 are strikingly similar. Indeed - it helps if you put the bytes in the right order!

For hysterical raisins, the raw socket interface on BSD-derived network stacks expects the ip_len field of the IP header included when IP_HDRINCL is sent to be in host byte order. dhclient used to only send packets with headers through the BPF, which will put the packet on the wire exactly as given (ie: the ip_len needs to be in the right order). For reasons which don't seem to be explained in CVS history, OpenBSD decided to change this behaviour in their network stack (making it differ from every other network stack and many books written about sockets).

To make a very long story short: I committed revision 198352 to make dhclient on FreeBSD work in networks which put sharp teeth between DHCP clients and servers. Debugging the problem also kept me out of trouble for a couple of hours.

I'm told that finding the cause of weird errors in the protocol stack is now significantly easier with DTrace. I will have to find some time to play with that. While ddd "works", it's not exactly the most pleasant tool to work with.

Entirely aside: I'm still not convinced that "sharp teeth" should care about the source port of unicast DHCPREQUEST messages, but I'm happy to accept that if everyone uses port 68, there's no reason to gratuitously differ from that. Thanks to the Telenetists for helping me look into this.

Edwin Groothuis: tzsetup(8) changes

In the last couple of days I have scratched a couple of the itches I had with regarding to the timezone database on the FreeBSD Operating System, all related to the (in)ability to update /etc/localtime automatically or quickly:

  • After running tzsetup(8), it will keep the name of the select zoneinfo file in /var/db/zoneinfo.
  • You can automatically reinstall the last selected zoneinfo name (after an upgrade with cvsup or the misc/zoneinfo port) via the command tzsetup -r.
  • Support for installation of installation with the DESTDIR variable set via the -C option.
  • If you want to change your timezone and you know the zoneinfo name you want to change it to, you can do it quickly via the command tzsetup Australia/Sydney.

This feature is currently only available in FreeBSD -CURRENT, after the release of 8.0 I will merge it back into FreeBSD 8.0 and 7.0.

The port misc/zoneinfo and the installation script of src/share/zoneinfo do support these new features.

FreeBSD Foundation: New Funded Project

The FreeBSD Foundation is pleased to announce a new funded project!

Pawel Jakub Dawidek has been awarded a grant to implement storage replication software that will enable users to use the FreeBSD operating system for highly available configurations where data has to be shared across the cluster nodes. The project is partly being funded by OMCnet Internet Service GmbH and TransIP BV.

The software will allow for synchronous block-level replication of any storage media (GEOM providers, using FreeBSD nomenclature) over the TCP/IP network and for fast failure recovery. HAST will provide storage using GEOM infrastructure, which means it will be file system and application independent and could be combined with any existing GEOM class. In case of a master node failure, the cluster will be able to switch to the slave node, check and mount UFS file system or import ZFS pool and continue to work without missing a single bit of data.

"High-availability is the number one requirement for any serious use of any operating system," said Pawel Jakub Dawidek, FreeBSD Developer. "Highly available storage is one of the key components in such environments. I strongly believe there are many FreeBSD users that have been waiting a long time for this functionality. I'll do my best to deliver software that matches FreeBSD quality and that will satisfy the needs of our users."

Pawel has been an active FreeBSD committer since 2003. During this period, he has touched almost every part of the kernel. But, his main interest in FreeBSD is storage and security related topics. Pawel is the author of various GEOM classes (eli, mirror, gate, label, journal, hsec, etc.), geom(8) utility, various open crypto improvements as well as port of the ZFS file system from OpenSolaris to FreeBSD.

The project will complete by February 2010.

Remko Lodder: Lukemftpd

So, now a while after the disconnect of ”lukemftpd”, I only got one response from Ed Schouten mentioning that I could have done it with a ‘src.conf’ setting. I decided not to do that, but that were all reactions. So given that, it might be that people are either not noticing it, or something else is wrong. I would have assumed that at least several people would complain that their lukemftpd doesn’t work any longer, or at least no longer gets installed.

+1 for success :-)

Upcoming FreeBSD Events: AsiaBSDCon 2010

AsiaBSDCon 2010 (http://2010.asiabsdcon.org/), Tokyo University of Science, Tokyo, Japan 11 - 14 March, 2010. AsiaBSDCon is a conference for users and developers on BSD based systems. The conference is for anyone developing, deploying and using systems based on FreeBSD, NetBSD, OpenBSD, DragonFlyBSD, Darwin and MacOS X. AsiaBSDCon is a technical conference and aims to collect the best technical papers and presentations available to ensure that the latest developments in our open source community are shared with the widest possible audience.

Upcoming FreeBSD Events: FOSDEM ’10

FOSDEM '10 (http://fosdem.org/2010/), ULB Campus Solbosh, Brussels, Belgium 6 - 7 February, 2010. FOSDEM '10 is a free and non-commercial event organized by the community, for the community. Its goal is to provide Free and Open Source developers a place to meet. Several FreeBSD developers will be present.

Florent Thoumie: Planet FreeBSDish update (again)

So, that WordPress plugin I mentioned previously has been working pretty well and I might replace Planet faster than I thought. Actually I might do that over the weekend.

A few users probably won’t be happy that the “complete” version is going away. I don’t have plans for it at the moment. If you think something else is missing, leave a comment.

If you’re meant to be listed on blogs.freebsdish.org but you’re not, then drop me an email or leave a comment and I’ll (re-)add you.
If you’re in the list but don’t put your posts in the FreeBSD category, then they won’t be aggregated.

Share and Enjoy: Digg del.icio.us Facebook Google Bookmarks Twitter

Related posts:

  1. Another Planet FreeBSD in testing… Alright, so I just found out about that FeedWordPress plugin...

Related posts brought to you by Yet Another Related Posts Plugin.

Upcoming FreeBSD Events: EuroBSDCon 2010

EuroBSDCon 2010 (http://2010.eurobsdcon.org/), Karlsruhe, Germany 8 - 10 October, 2010. The ninth annual European BSD Conference will take place in Karlsruhe, Germany in October, 2010, and include a technical track, tutorials, and FreeBSD developer summit.

Upcoming FreeBSD Events: OpenRheinRuhr 2009

OpenRheinRuhr 2009 (http://www.openrheinruhr.de/), Saalbau, Bottrop, Germany 7 - 8 November, 2009. This new event in the middle of Europe will see a huge audience and an impressive list of exhibitors. FreeBSD will have a booth as well as the other major BSDs.

Upcoming FreeBSD Events: discuss & discover 2009

discuss & discover 2009 (http://en.discuss-discover.com/), Messe München, Munich, Germany 20 - 22 October, 2009. Discuss & discover is the successor of Systems. FreeBSD will have a booth as well as the other major BSDs and will try to repeat the great success of past years. There will be an Open Source conference with workshops, talks and a theme park for various projects.

Ivan Voras: The night of 1000 jails

As FreeBSD 8.0 is right around the corner it's the right time to get it some more exposure. Just for kicks I got the idea to stress the Jails subsystem - the cheap (both in $$$ and resource requirements) OS-level virtualization technology present in FreeBSD for nearly 10 years now. Behold... the bootup of 1,000, count them - 1,000 virtual machines on a single host with 4 GB of RAM.

Read more...

Florent Thoumie: Another Planet FreeBSD in testing…

Alright, so I just found out about that FeedWordPress plugin for WordPress and I figured I would give it a spin. It seems to be doing everything I did with Planet, and has a few features (shared admin rights through wordpress accounts, mark new posts as pending instead of publishing them straight away) that could prove useful if I want to poke core@ about planet.freebsd.org once again.

Anyway, check it out.

Share and Enjoy: Digg del.icio.us Facebook Google Bookmarks Twitter

Related posts:

  1. RFC: OpenSMTPD for FreeBSD I don’t like writing long posts so let’s go straight...

Related posts brought to you by Yet Another Related Posts Plugin.

Gleb Kurtsou: pefs dircache benchmark

I’ve recently added directory caching into pefs (sources tarball available here and here).

Despite of being directory listing cache (like dirhash for ufs) it also acts as encrypted file name cache. So that there is no need to decrypt names for the same entries all the time. That was really big issue because directory listing has to be reread on almost every vnode lookup operation. It made operations on directories with 1000 and more files too time consuming.

The cache is getting updated at two points: during vnode lookup operation and during readdir call. Vnode generation attribute is used to monitor directory changes (the same way NFS works) and expire the cache if it changes. There is no per-operation monitoring because that would violate stacked filesystem nature (and also complicate the code). There are some issues regarding large directories handling within dircache. First of all results of consequent readdir calls considered inconsistent, i.e cache expires if user provided buffer is too small to fit entire directory listing. And while doing a vnode lookup search doesn’t terminate if matching directory entry found, it further traverses directory to update the cache.

There is vfs.pefs.dircache_enable sysctl to control cache validity. Setting it to zero would force always treating cache as invalid, and thus dircache would function only as a file name encryption cache.

At the moment caching is only enabled for name decryption, but there are operations like rm or rmdir which perform name encryption on every call to pass data to underlying filesystem. Enabling caching for such operations is not going to be hard, but I just want code to stabilize a bit before moving further.

I’ve performed two types of tests: dbench and handling directories with large number of files. I’ve used pefs mounted on top of tmpfs to measure pefs overhead but not disk io performance. Salsa20 algorithms with 256 bit key was chosen because of being the fastest available. Before each run underlying tmpfs filesystem was remounted. Each test was run for 3 times, and average of results is shown in charts (distribution was less then 2%). Also note that I’ve used kernel with some extra debugging compiled in (invariants, lock debugging).

dbench doesn’t show extra large difference comparing to plain pefs and old pefs without dircache: 143,635 Mb/s against 116,746 Mb/s; it’s 18% improvement witch is very good imho. Also interesting is that result gets just a bit lower after setting vfs.pefs.dircache_enable=0: 141,289 Mb/s with dircache_enable=0 against 143,635 Mb/s.

Dbench uses directories with small number of entries (usually ~20). That perfectly explains the results achieved. Handling large directories is where dircache shines. I’ve used the following trivial script for testing, it creates 1000 or 2000 files, does ‘ls -l’ and removes these files:
for i in `jot 1000`; do
touch test-$i
done
ls -Al >/dev/null
find . -name test-\* -exec rm '{}' +

The chart speaks for itself. And per file overhead looks much closer to expected linear growth after running the same test for 3000 files: