2009-02-13 08:15:55

by Vitja Makarov

[permalink] [raw]
Subject: compat-wireless with CONFIG_MAC80211disabled

Hi!

I was trying to build compat wireless for my arm board.
First of all I disabled CONFIG_MAC80211 in my kernel, and successfully
built compat-wireless.

Then at runtime I get kernel panic.
Then I found that sk_buff in 2.6.28 depends on CONFIG_MAC80211, so
enabling it solves my problem.

Shouldn't compat-wireless Makefile check kernel dot config for this
option as well as for wireless extension?

Thanks,
vitja.


2009-02-14 03:17:08

by Pat Erley

[permalink] [raw]
Subject: Re: compat-wireless with CONFIG_MAC80211disabled

Luis R. Rodriguez wrote:
>> Is there interest in a patch allowing you to
>> set something like FORCE=y on the CLI to override these patches?
>
> Do you have CONFIG_NET_DMA?
> If not do you have CONFIG_NETWORK_SECMARK?
>
> It'd be interesting to see what net core is doing due to the rape and
> it'd be even more interesting if we can determine the rape is allowed
> during certain circumstances, therefore allowing us to hack config.mk
> to allow for such atrocities to go on.

Yes to CONFIG_NETWORK_SECMARK, No to CONFIG_NET_DMA.

Pat

2009-02-14 02:43:25

by Pat Erley

[permalink] [raw]
Subject: Re: compat-wireless with CONFIG_MAC80211disabled

Luis R. Rodriguez wrote:
> On Fri, Feb 13, 2009 at 4:54 AM, Vitja Makarov <[email protected]> wrote:
>> This should be problem for 2.6.27 too.
>
> modified for 27 and applied, thanks

I didn't run into this problem with 2.6.28-gentoo-r1... I've been running
compat-wireless from git since the 4th on this kernel, with no mac80211
enabled and had no problems. Is there interest in a patch allowing you to
set something like FORCE=y on the CLI to override these patches?

Pat Erley

2009-02-14 03:24:30

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: compat-wireless with CONFIG_MAC80211disabled

On Fri, Feb 13, 2009 at 7:16 PM, pat-lkml <[email protected]> wrote:
> Luis R. Rodriguez wrote:
> >> Is there interest in a patch allowing you to
>>> set something like FORCE=y on the CLI to override these patches?
>>
>> Do you have CONFIG_NET_DMA?
>> If not do you have CONFIG_NETWORK_SECMARK?
>>
>> It'd be interesting to see what net core is doing due to the rape and
>> it'd be even more interesting if we can determine the rape is allowed
>> during certain circumstances, therefore allowing us to hack config.mk
>> to allow for such atrocities to go on.
>
> Yes to CONFIG_NETWORK_SECMARK, No to CONFIG_NET_DMA.

Then I take it you haven't yet used this feature:


config NETWORK_SECMARK
bool "Security Marking"
help
This enables security marking of network packets, similar
to nfmark, but designated for security purposes.
If you are unsure how to answer this question, answer N.

Which you seem to be able to use if you enable and use:


config NF_CONNTRACK_SECMARK
bool 'Connection tracking security mark support'
depends on NETWORK_SECMARK
default m if NETFILTER_ADVANCED=n
help
This option enables security markings to be applied to
connections. Typically they are copied to connections from
packets using the CONNSECMARK target and copied back from
connections to packets with the same target, with the packets
being originally labeled via SECMARK.

If unsure, say 'N'.

or:

config NETFILTER_XT_TARGET_SECMARK
tristate '"SECMARK" target support'
depends on NETWORK_SECMARK
default m if NETFILTER_ADVANCED=n
help
The SECMARK target allows security marking of network
packets, for use with security subsystems.

To compile it as a module, choose M here. If unsure, say N.

Not like I have any clue what the hell this is used for despite the explanation.

Luis

2009-02-13 11:47:34

by Vitja Makarov

[permalink] [raw]
Subject: Re: compat-wireless with CONFIG_MAC80211disabled

2009/2/13 Luis R. Rodriguez <[email protected]>:
> On Fri, Feb 13, 2009 at 12:15 AM, Vitja Makarov <[email protected]> wrote:
>> Hi!
>>
>> I was trying to build compat wireless for my arm board.
>> First of all I disabled CONFIG_MAC80211 in my kernel, and successfully
>> built compat-wireless.
>>
>> Then at runtime I get kernel panic.
>> Then I found that sk_buff in 2.6.28 depends on CONFIG_MAC80211, so
>> enabling it solves my problem.
>
> Ah nice catch. Well you're the first to try that and report it.
>
>> Shouldn't compat-wireless Makefile check kernel dot config for this
>> option as well as for wireless extension?
>
> Yes, Can you send a patch, put some nasty warn on config.mk if its not
> enabled on 2.6.28 and error out.
>
> Luis
>

Here is patch, sorry for attachment, firewall here blocks all email
related ports.

vitja.


Attachments:
error-on-mac80211-disabled.diff (1.35 kB)

2009-02-13 22:49:23

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: compat-wireless with CONFIG_MAC80211disabled

On Fri, Feb 13, 2009 at 4:54 AM, Vitja Makarov <[email protected]> wrote:
> This should be problem for 2.6.27 too.

modified for 27 and applied, thanks

2009-02-13 12:54:46

by Vitja Makarov

[permalink] [raw]
Subject: Re: compat-wireless with CONFIG_MAC80211disabled

This should be problem for 2.6.27 too.

vitja.

2009-02-14 03:08:24

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: compat-wireless with CONFIG_MAC80211disabled

On Fri, Feb 13, 2009 at 6:43 PM, pat-lkml <[email protected]> wrote:
> Luis R. Rodriguez wrote:
>> On Fri, Feb 13, 2009 at 4:54 AM, Vitja Makarov <[email protected]> wrote:
>>> This should be problem for 2.6.27 too.
>>
>> modified for 27 and applied, thanks
>
> I didn't run into this problem with 2.6.28-gentoo-r1... I've been running
> compat-wireless from git since the 4th on this kernel, with no mac80211
> enabled and had no problems.

Oh interesting, because skb->do_not_encrypt was there on 27, and
skb->requeue was added as of 28. Since config.mk was enforcing it to
be enabled and since compat-wireless uses its own
include/linux/compat_autoconf.h with values derived from config.mk
when building compat-wireless you were getting

#define CONFIG_MAC80211 1

and therefore compat-wireless did build correctly assuming your
kernel's skb_buff had skb->do_not_encrypt and skb->requeue although
the reality of it is that it didn't therefore probably forcing
mac80211 to mess around with other nearby fields in the skb_buff like
the skb->dma_cookie, skb->secmark or skb->mark, depending on whether
CONFIG_NET_DMA, CONFIG_NETWORK_SECMARK or neither were enabled
respectively.

So it seems it was working by chance as your kernel's skbs were being
raped by mac80211 in their sleep.

> Is there interest in a patch allowing you to
> set something like FORCE=y on the CLI to override these patches?

Do you have CONFIG_NET_DMA?
If not do you have CONFIG_NETWORK_SECMARK?

It'd be interesting to see what net core is doing due to the rape and
it'd be even more interesting if we can determine the rape is allowed
during certain circumstances, therefore allowing us to hack config.mk
to allow for such atrocities to go on.

Luis

2009-02-13 08:23:48

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: compat-wireless with CONFIG_MAC80211disabled

On Fri, Feb 13, 2009 at 12:15 AM, Vitja Makarov <[email protected]> wrote:
> Hi!
>
> I was trying to build compat wireless for my arm board.
> First of all I disabled CONFIG_MAC80211 in my kernel, and successfully
> built compat-wireless.
>
> Then at runtime I get kernel panic.
> Then I found that sk_buff in 2.6.28 depends on CONFIG_MAC80211, so
> enabling it solves my problem.

Ah nice catch. Well you're the first to try that and report it.

> Shouldn't compat-wireless Makefile check kernel dot config for this
> option as well as for wireless extension?

Yes, Can you send a patch, put some nasty warn on config.mk if its not
enabled on 2.6.28 and error out.

Luis