Bug 145024 - [linux] [patch] kernel crash by linux.ko module with nooptions COMPAT_FREEBSD32
Summary: [linux] [patch] kernel crash by linux.ko module with nooptions COMPAT_FREEBSD32
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dmitry Chagin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-25 11:10 UTC by Oleg Ginzburg
Modified: 2011-02-13 08:46 UTC (History)
0 users

See Also:


Attachments
linux-module.diff (425 bytes, patch)
2011-01-31 10:14 UTC, Alexander Best
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Ginzburg 2010-03-25 11:10:02 UTC
kernel crash by linux.ko module with nooptions COMPAT_FREEBSD32

How-To-Repeat: have kernel from kernel config like:
--
include GENERIC

ident           GENERIC-NOCOMPAT_FREEBSD32

nooptions      COMPAT_FREEBSD32        # Compatible with i386 binaries
--

and 

linux_load="YES"

in /boot/loader.conf

then try to boot.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2010-03-27 05:15:20 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-emulation

Over to maintainer(s).
Comment 2 Alexander Best freebsd_committer freebsd_triage 2011-01-30 18:13:13 UTC
State Changed
From-To: open->analyzed

We have two possibilities in order to fix this issue: 

1) Add something like the following somewhere in sys/amd/linux32: 

#ifndef COMPAT_FREEBSD32 
#error "linux emulation requires COMPAT_FREEBSD32  
option for non 32 bit architectures" 
#endif 

2) Find a way to avoid the freebsd32_exec_copyin_args() call in 
linux32_machdep.c. I believe this is the only place in the sys/amd/linux32 
code that depends on sys/amd64/ia32 code. 

NB: I've removed the panic tag from this PR. I was able to reproduce the issue, 
however a panic didn't occur. The problem is that 
freebsd32_exec_copyin_args() wasn't compiled into the kernel and loading the 
linux kernel module thus fails.
Comment 3 Alexander Best freebsd_committer freebsd_triage 2011-01-31 10:14:20 UTC
this patch should solve the issue.

cheers.
alex

-- 
a13x
Comment 4 Dmitry Chagin freebsd_committer freebsd_triage 2011-02-13 08:40:51 UTC
Responsible Changed
From-To: freebsd-emulation->dchagin

Take it.
Comment 5 Dmitry Chagin freebsd_committer freebsd_triage 2011-02-13 08:41:42 UTC
State Changed
From-To: analyzed->closed

The linux module depends on COMPAT_FREEBSD32 since r205014.