Muli Ben-Yehuda's journal

June 10, 2004

FSF splurging

Filed under: Uncategorized — Muli Ben-Yehuda @ 12:22 PM

Taking my cue from yrk, I have just become a Free Software Foundation card-carrying Associate Member. In addition, I ordered the GNU Project 20th Anniversary T-shirt, the original Classic Typing Gnu T-shirt, and the GNU Project 20th Anniversary Travel Mug. Yay for splurging for a good cause!

This afternoon we will be heading out to the yearly Book Fair. I foresee more splurging in my future.

June 9, 2004

pics from yrk’s talk at Haifux on GIMP and the Digital Darkroom

Filed under: Uncategorized — Muli Ben-Yehuda @ 11:16 PM

yrk

A Touching Story

Filed under: Uncategorized — Muli Ben-Yehuda @ 6:38 PM

Oleg posted a new All Code Sucks entry, titled A Touching Story. Entertaining as usual… go ahead and submit your own!

PNS day 31: no pain, no gain

Filed under: Uncategorized — Muli Ben-Yehuda @ 3:03 PM

Workout this morning was a bitch. I had to drag myself out of bed, drag myself to the gym, and drag myself on and off each and every one of the machines I used. Swimming the 1km yesterday, coupled with the drinks I had at night in the Hessel’s pub left in less than spectacular shape this morning.

why user programs can’t access the kernel’s mapping, cont

Filed under: Uncategorized — Muli Ben-Yehuda @ 2:58 PM

Yesterday I wrote about “the story of a page
fault”
, ending with “What I am not absolutely convinced about is
why the fault happens in the first place. The options are that it gets
a fault because the kernel is mapped, but the protection on the ptes
is such that only code running in ring 0 (i.e. the kernel) can access
them, or that the kernel is not mapped while we are running in user
space, and is only mapped in when we context switch to kernel
space. The former makes a lot more sense, but I haven’t yet hunted
down the code that does it.”

Well, I found it 🙂

in 2.6.7-rc3, arch/i386/mm/pgtable.c, pgd_ctor():

void pgd_ctor(void *pgd, kmem_cache_t *cache, unsigned long unused)
{
	unsigned long flags;

	if (PTRS_PER_PMD == 1)
		spin_lock_irqsave(&pgd_lock, flags);

	/* muli: copy into the user's pgd the portion of the swapper_pg_dir that maps the kernel */ 
	memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
			swapper_pg_dir + USER_PTRS_PER_PGD,
			(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));

	if (PTRS_PER_PMD > 1)
		return;

	pgd_list_add(pgd);
	spin_unlock_irqrestore(&pgd_lock, flags);

	/* muli: set the rest to 0 */ 
	memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
}

The way I found it is to go through mingo’s 4:4 split patch,
which obviously needs to change this bit, since the kernel is no
longer mapped in each process’s address space.

the postfix bug that isn’t

Filed under: Uncategorized — Muli Ben-Yehuda @ 12:18 PM

I just spent a couple of hours tweaking the postfix installation on my desktop
machine, alhambra. I got everything working to my satisfaction, and
then noticed that bounce messages contain the line “For further
assistance, please send mail to “. The bit
looks incorrect, since I would expect it to be a real email
address. I looked in HOWTOs, read the configuration files, searched
the web, and couldn’t find any way to tell postfix which address to
use. Eventually, I downloaded the source and verified that indeed
there is no way to set this particular string. In
src/bounce/bounce_notify_util.c, we have the line

	post_mail_fprintf(bounce,
			  "For further assistance, please send mail to ",
			  MAIL_ADDR_POSTMASTER);

where MAIL_ADDR_POSTMASTER is defined in src/global/mail_addr.h as

#define MAIL_ADDR_POSTMASTER	"postmaster"
#define MAIL_ADDR_MAIL_DAEMON	"MAILER-DAEMON"
#define MAIL_ADDR_EMPTY		""

extern const char *mail_addr_double_bounce(void);
extern const char *mail_addr_postmaster(void);

Hmm, thinks I, perhaps MAIL_ADDR_POSTMASTER is a default and
mail_addr_postmaster() does the fully qualified domain name bit? let’s
see. src/global/mail_addr.c:

const char *mail_addr_postmaster(void)
{
    static char *addr;

    if (addr == 0)
	addr = concatenate(MAIL_ADDR_POSTMASTER, "@",
			   var_myhostname, (char *) 0);
    return (addr);
}

Couldn’t be much clearer than that. Looks like someone used
MAIL_ADDR_POSTMASTER rather than mail_addr_postmaster(). Not the sort
of silly bug I’d expect in postfix, but stranger things have
happened. Cool, a bug I can report and fix.

Well, let’s see where to report bugs in postfix. Nothing in the
source, no -devel mailing list. Maybe I should report it against the
debian package? Hmm, maybe one of the FAQs will have more information
on it? let’s try this one?. While
browsing through it, what do I see? When Postfix
sends a bounce message, it tells the sender, “For further assistance,
please send mail to…
, which states:

 
4. When Postfix sends a bounce message, it tells the sender, "For
   further assistance, please send mail to 'postmaster'" But I want it
   to include my domain name in the address,
   e.g. . How can I do that? 

The idea behind this is that people who receive this notification
should contact their own local postmasters, since they may very well
be the ones who have to deal with the problem. If you really want to
change it, you have to modify the source code.  

To which I have only one thing to say: D’oh!

June 8, 2004

PNS day 30 – what would a SEAL do?

Filed under: Uncategorized — Muli Ben-Yehuda @ 6:41 PM

Weight continues dropping, and I’m breaking new grounds. May the trend continue unabated!

This morning I went to the pool and swam my customary 1 kilometer. I was very close to quitting at the 500 meters mark and at the 750 meters mark. Each time, I asked myself what a SEAL would do, and just kept going. As the gym-master says, exercising is half muscles and three quarters will power.

My reward for the swim is aching all over, and a small measure of satisfaction at not quitting. I’ll take the latter even with the former any day.

Tomorrow the plan is weights in the morning, and likewise on Thursday. I’m thinking tennis on Saturday will be swell… now I just need to find a partner-in-crime.

Aviram Jenik talk on “Application level attacks: Security holes are YOUR fault”

Filed under: Uncategorized — Muli Ben-Yehuda @ 6:35 PM

Aviram Jenik of BeyondSecurity gave a most entertaining talk this morning at HRL. Hearing Aviram talk is always a pleasure, and this morning was no different.

the story of a (page) fault

Filed under: Uncategorized — Muli Ben-Yehuda @ 6:15 PM

I just added some tracing code to arch/i386/mm/fault.c:do_page_fault() and it worked on the first try. I love it when that happens!

I’m trying to figure out why a user space program that accesses the area where the kernel is supposedly mapped (above PAGE_OFFSET,
e.g. 0xC0000004) gets killed. I know (vis-a-vis the tracing code
mentioned above) that it gets a page fault, sees that it’s above PAGE_OFFSET and a user space fault, and then sends a SIGSEGV. What I am not absolutely convinced about is why the fault happens in the first place. The options are that it gets a fault because the kernel is mapped, but the protection on the ptes is such that only code running in ring 0 (i.e. the kernel) can access them, or that the kernel is not mapped while we are running in user space, and is only mapped in when we context switch to kernel space. The former makes a lot more sense, but I haven’t yet hunted down the code that does it.

This question came up in the context of our reading group at work that is reading Mel Gorman’s Understanding the Linux VM book. The books is not great for our needs (too many details, not enough overview and concepts), but provides great context for the discussions.

June 7, 2004

PNS day 29 – Ouchuga wooga!

Filed under: Uncategorized — Muli Ben-Yehuda @ 11:15 AM

Mysterious are the ways of my metabolism. After the weekend’s pizza flavored disaster, I hit the scales this morning and see that I’m back to my lowest-ever weight since starting PNS training. Woohoo!

Good workout this morning, the kind I end up drenched in sweat afterward. 30 minutes on the cross trainer, some weights (lever chest press and lever front pulldown), and then abs.

The trainer guy in the gym, who’s very experienced and obviously knows what he’s talking about, to judge by his bulging muscles, told me to concentrate on muscle stamina (20 reps at least in each set) rather than strength. I think I’ll do stamina reps on legs, back and shoulders, and strength or stamina and then strength on pushups and pullups.

Tomorrow morning I hit the pool. Looking forward to it.

Oh, and shapirac, I finished my Vorkosigan book last night and am now reading Heinlein’s Starship Troopers again. I’ll take motivation any damned place I can find it!

« Previous PageNext Page »

Blog at WordPress.com.