FreeBSD

共 688 篇文章。

Google SoC 2009/FreeBSD

• Development

之前在水木社区发过,这里也发一下。

我们目前正在寻找有意参加这次活动的在校学生。Google Summer of Code 是由Google公司赞助的供在校学生参与开源项目的暑期活动。目前,FreeBSD已经被选为符合资格的 mentoring organization,这是 FreeBSD 第 5 年参与 GSoC。

重要的日期:

  • 3月23日 - 开始接受申请
  • 4月 3日 - 申请截止日期
  • 4月15日 - 对申请的审核结束
  • 4月20日 - 正式宣布赞助的学生
  • 5月23日 - 项目正式开始
  • 7月 6日 - 开始提交中期评估
  • 7月13日 - 中期评估最后日期
  • 8月10日 - 推荐的项目完成时间,接下来的一周时间建议用于修正代码、完善文档等。
  • 8月17日 - 开始提交最终评估
  • 8月24日 - 最终评估deadline

Google将为获得资助的学生提供每人 $4,500 的资助,分3次支付;同时,对于每个项目,Google还会为对应的开源项目提供 $500 的资助。

关于 FreeBSD 本次 SoC 活动的 网站。

阅读全文… ( 本文约 543 字,阅读大致需要 2 分钟 )

关于本地特权提升

• Security

FreeBSD 今天发布了 2009 年第 6 号安全公告 FreeBSD-SA-09:06.ktimer。这个安全公告适用于 7.0-RELEASE 以上到修正日期之前的所有 FreeBSD 版本。

由于这个安全公告修正的是一个零时差 (0-day,也就是发现者直接对问题进行了全面披露,而不是等待供应商修正之后再发布漏洞细节) 披露的漏洞,因此,适当地评估其风险并采取措施就非常重要。安全公告中提到,这是一个"Local privilege escalation"(本地特权提升问题),这种问题属于一类非常常见的(特别是 Linux 内核)、严重的安全漏洞,具体来说,通过一定的方法,登录在系统上的用户可以提升其权限,并实施进一步的攻击。

关于这类漏洞的一个常见的误解是,“本地"漏洞通常是没什么大碍的。然而,那种无关大碍的一类"本地"漏洞,指的是只能在本地控制台触发的问题。例如,如果手中有一张包含了某些工具的Windows PE光盘,用它启动系统便可以得到本地的管理员权限—-这是一个安全问题,但是并不严重,因为事实上如果别人能够接触本地系统,那么他就可以做任何事情。

而 FreeBSD-SA-09:06 指出的问题则不是这类问题。在其上下文中,“本地"是指能够登入系统的任何用户,以及能够以本地用户身份运行的服务进程。对于 Web 服务器而言,这是一个非常严重的安全威胁—-例如,如果在设计时因为疏忽而没有考虑上传文件是否有可能由于某种条件被执行,那么,之前这可能只是一个简单的 DoS 问题(例如,用户可以上传一个不停 fork() 的程序,将 www 用户的进程配额耗尽而导致新的服务请求无法被及时响应),而有了这个漏洞,这些问题便成了远程特权提升问题,其危害也就非常严重了。

阅读全文… ( 本文约 898 字,阅读大致需要 2 分钟 )

为什么FreeBSD没有CIRCLEQ_*

• Development

最近在看 Berkeley DB,发现一套 FreeBSD 上没有的宏, CIRCLEQ_*。

看了一下,这组宏是来自 4.4BSD 的,因此 FreeBSD 曾经有过这个宏;后来, phk 在 2000 年 12 月 29 日从 FreeBSD 里面把它拿掉了(SVN revision 70469),当时的说明如下:

阅读全文… ( 本文约 324 字,阅读大致需要 1 分钟 )

OpenJDK on FreeBSD

• Development

Maho今天正式commit了 OpenJDK 的port,表面上看这是一小步,但在我看来这却是一项历史性的进步,因为终于可以不再受到之前那个 click-through 许可证的限制了(也就是说,可以几乎没有任何限制地随光盘,或者通过网站提供可用的jdk源代码和二进制版本了)。

阅读全文… ( 本文约 147 字,阅读大致需要 1 分钟 )

一个问题请教WxWidget高手

• Development

WxClassInfo的析构函数(~WxClassInfo)死循环是什么原因?检查发现RTTI的那个链表有个环,但是不太明白这个表(从上下文看是由Register()方法维护的)为什么能出现环?

阅读全文… ( 本文约 155 字,阅读大致需要 1 分钟 )

BeOS Reborn: Haiku

• Development

Pretty interesting project: Haiku.

It looks like that it uses a lot of FreeBSD code by creating glue between FreeBSD and BeOS API, on the other hand they are using MIT license for most of their code, making sharing code easy.

参与评论

memchr(3) rewrite

• Development

I have taken some time to rewrite memchr(3) to utilize similiar algorithm as my strlen(3) did. Two different formular, however, would have a roughly 1/3 difference.

Currently I have taken an approach that when memchr(3) is trying to match a pattern of 8-bit, then consider the string as 8-bit, which uses the first formular which is expected to have uniform O(n) time complexity by reducing unnecessary branches.

This approach, however, might be bogus since if you find 7-bit character within a 8-bit string, in that case, memchr(3) would perform poorly, if there are a lot of characters having their MSB as 1.

阅读全文… ( 本文约 114 字,阅读大致需要 1 分钟 )

Progress on LLVM clang

• Development

As some of you already know, FreeBSD, along with some other Open Source projects, is moving away from GCC due to GPLv3. From a technology perspective, this also makes sense since the (likely) candidate, BSD-style licensed, LLVM based clang, a C compiler, is making reasonably good progress.

So, what should we expect from LLVM or clang?

Here is a good comparison between GCC and clang. Despite GCC is popular, considerably more mature, and supports more languages (especially C++, which clang’s support is incomplete at this moment), clang provides cleaner AST (Abstract Syntax Tree), much more modularized (if you take a look at GCC’s history, Richard Stallman intentionally made GCC’s code not reusable in other software), provided much more information for optimizer, is much faster and use much less memory, etc.

For FreeBSD, currently, clang can compile its kernel with only very few tweaks.

阅读全文… ( 本文约 315 字,阅读大致需要 2 分钟 )

New strlen(3) committed

• Development

Finally, I got my strlen(3) [1] committed against -HEAD. This is a long story, to put it short, I had proposed assembly version of some string operations at the point of 2005, but these was never committed due to a hard disk failure, and as Bruce pointed out, having the hand optimized assembly code use a different algorithm is not good in general.

Therefore, I have take some time on it and reimplemented the idea in C, resulting in a portable (say, you can use it on any 32-bit or 64-bit processors, and it can be easily extended to 128-bit) version.

So, is it important for *YOU*?

Generally speaking, it should not. Performance sensitive programs should, by all means, avoid C style string operations. Think a 5x better strlen(3) would boost performance of your application since it uses strlen(3) in critical path? Think again!

However, I found it valuable. There is difference in worldstone, where I saw some minor improvements. Micro-benchmark indicates that this version is at most 2x slower when the string is very short, but 5x faster for strings that is at least word-length long.

[1] Note: the version has been further revised to provide better comment and match style(9).

阅读全文… ( 本文约 295 字,阅读大致需要 2 分钟 )

7.1-RELEASE升级流量冲击导致portsnap服务同步受阻

• Development

许多老派的 FreeBSD 用户喜欢用源代码方式升级。运行了十多年的基于 cvsup 的同步机制由于有很多镜像支持因此一直没有遇到太大的问题,但是 FreeBSD 6.1 开始引入的 freebsd-update 提供了新的以二进制形式更新系统的方法,最近几年 FreeBSD 内核的许多改进已经使编译自定义的内核不再像以前那样重要了。

阅读全文… ( 本文约 193 字,阅读大致需要 1 分钟 )