# Re: \[PATCH 2/2 v2\] netlink: kill eff\_cap from struct netlink\_skb\_parms

- List: linux-fbdev
- 8 messages, 5 authors
- Page: https://ratatoskr.run/linux-fbdev/2011/03/10865568/t

## Re: \[PATCH 2/2 v2\] netlink: kill eff\_cap from struct netlink\_skb\_parms

- From: Lars Ellenberg \<hidden\>
- Date: 2011-03-03 22:37:46 
- Message: https://ratatoskr.run/linux-fbdev/2011/03/10865568.md

```text
On Thu, Mar 03, 2011 at 12:15:22PM -0800, Chris Wright wrote:
> * David Miller (davem@davemloft.net) wrote:
> > From: Chris Wright <redacted>
> > Date: Thu, 3 Mar 2011 09:32:30 -0800
> > 
> > > * Patrick McHardy (kaber@trash.net) wrote:
> > > 
> > >> commit 8ff259625f0ab295fa085b0718eed13093813fbc
> > >> Author: Patrick McHardy [ref]
> > >> Date:   Thu Mar 3 10:17:31 2011 +0100
> > >> 
> > >>     netlink: kill eff_cap from struct netlink_skb_parms
> > >>     
> > >>     Netlink message processing in the kernel is synchronous these days,
> > >>     capabilities can be checked directly in security_netlink_recv() from
> > >>     the current process.
> > >>     
> > >>     Signed-off-by: Patrick McHardy [ref]
> > > 
> > > Thanks for doing that Patrick.  I looked at this earlier and thought
> > > there was still an async path, but I guess that's just to another
> > > userspace process.
> > > 
> > > BTW, I think you missed a couple connector based callers:
> > > 
> > > drivers/staging/pohmelfs/config.c:      if (!cap_raised(nsp->eff_cap, CAP_SYS_AD
> > > drivers/video/uvesafb.c:        if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN))


Last time I checked, current() for connector based netlink message
consumers was the work queue that is used for connector.

So unless that changed, or my understanding is wrong, current_cap()
inside cn_queue_wrapper(), respectively the d->callback()
will not be the userland sender process' capabilities, but the work
queue capabilities.

If so, then this change introduces the possibility for normal users to
send privileged commands to connector based subsystems, even if they
may not be able to bind() to suitable sockets to receive any replies.

Am I missing something?

	Lars
```

## Re: \[Drbd-dev\] \[PATCH 2/2 v2\] netlink: kill eff\_cap from struct netlink\_skb\_parms

- From: Chris Wright \<hidden\>
- Date: 2011-03-03 23:53:05 
- Message: https://ratatoskr.run/linux-fbdev/2011/03/10865573.md

```text
* Lars Ellenberg (lars.ellenberg@linbit.com) wrote:
> Last time I checked, current() for connector based netlink message
> consumers was the work queue that is used for connector.
> 
> So unless that changed, or my understanding is wrong, current_cap()
> inside cn_queue_wrapper(), respectively the d->callback()
> will not be the userland sender process' capabilities, but the work
> queue capabilities.

Yes, you're right.

> If so, then this change introduces the possibility for normal users to
> send privileged commands to connector based subsystems, even if they
> may not be able to bind() to suitable sockets to receive any replies.
> 
> Am I missing something?

No, thanks for review.  This puts back the async issue.
```

## Re: \[Drbd-dev\] \[PATCH 2/2 v2\] netlink: kill eff\_cap from struct netlink\_skb\_parms

- From: Evgeniy Polyakov \<hidden\>
- Date: 2011-03-04 01:29:56 
- Message: https://ratatoskr.run/linux-fbdev/2011/03/10865576.md

```text
Hi.

On Thu, Mar 03, 2011 at 11:37:46PM +0100, Lars Ellenberg (lars.ellenberg@linbit.com) wrote:
> If so, then this change introduces the possibility for normal users to
> send privileged commands to connector based subsystems, even if they
> may not be able to bind() to suitable sockets to receive any replies.
> 
> Am I missing something?

Yup, connector is very async at that place, but I wonder why the hell I
ever made that decision. I believe we can replace it with pure sync call
of the registered connector callback, since netlink is synchronous and
no one has any problem with it.

-- 
	Evgeniy Polyakov
```

## Re: \[Drbd-dev\] \[PATCH 2/2 v2\] netlink: kill eff\_cap from struct netlink\_skb\_parms

- From: David Miller \<davem@davemloft.net\>
- Date: 2011-03-04 01:38:31 
- Message: https://ratatoskr.run/linux-fbdev/2011/03/10865577.md

```text
From: Evgeniy Polyakov <redacted>
Date: Fri, 4 Mar 2011 04:29:56 +0300

> Hi.
> 
> On Thu, Mar 03, 2011 at 11:37:46PM +0100, Lars Ellenberg (lars.ellenberg@linbit.com) wrote:
>> If so, then this change introduces the possibility for normal users to
>> send privileged commands to connector based subsystems, even if they
>> may not be able to bind() to suitable sockets to receive any replies.
>> 
>> Am I missing something?
> 
> Yup, connector is very async at that place, but I wonder why the hell I
> ever made that decision. I believe we can replace it with pure sync call
> of the registered connector callback, since netlink is synchronous and
> no one has any problem with it.

Yes, please it would really help us with what we're trying to do here.
```

## Re: \[Drbd-dev\] \[PATCH 2/2 v2\] netlink: kill eff\_cap from struct netlink\_skb\_parms

- From: Patrick McHardy \<hidden\>
- Date: 2011-03-08 14:50:47 
- Message: https://ratatoskr.run/linux-fbdev/2011/03/10865983.md

```text
Am 04.03.2011 02:29, schrieb Evgeniy Polyakov:
> Hi.
> 
> On Thu, Mar 03, 2011 at 11:37:46PM +0100, Lars Ellenberg (lars.ellenberg@linbit.com) wrote:
>> If so, then this change introduces the possibility for normal users to
>> send privileged commands to connector based subsystems, even if they
>> may not be able to bind() to suitable sockets to receive any replies.
>>
>> Am I missing something?
> 
> Yup, connector is very async at that place, but I wonder why the hell I
> ever made that decision. I believe we can replace it with pure sync call
> of the registered connector callback, since netlink is synchronous and
> no one has any problem with it.
> 

Are you going to do this or do you want me to take care of it?
```

## Re: \[Drbd-dev\] \[PATCH 2/2 v2\] netlink: kill eff\_cap from struct netlink\_skb\_parms

- From: Evgeniy Polyakov \<hidden\>
- Date: 2011-03-08 18:32:46 
- Message: https://ratatoskr.run/linux-fbdev/2011/03/10865989.md

```text
Hi Patrick.

On Tue, Mar 08, 2011 at 03:50:47PM +0100, Patrick McHardy (kaber@trash.net) wrote:
> > Yup, connector is very async at that place, but I wonder why the hell I
> > ever made that decision. I believe we can replace it with pure sync call
> > of the registered connector callback, since netlink is synchronous and
> > no one has any problem with it.
> 
> Are you going to do this or do you want me to take care of it?

I will return back at the end of the week and will take care of this
problem. I will not mind if you complete it first though :)

-- 
	Evgeniy Polyakov
```

## Re: \[Drbd-dev\] \[PATCH 2/2 v2\] netlink: kill eff\_cap from struct netlink\_skb\_parms

- From: Patrick McHardy \<hidden\>
- Date: 2011-03-08 18:54:33 
- Message: https://ratatoskr.run/linux-fbdev/2011/03/10865994.md

```text
Am 08.03.2011 19:32, schrieb Evgeniy Polyakov:
> Hi Patrick.
> 
> On Tue, Mar 08, 2011 at 03:50:47PM +0100, Patrick McHardy (kaber@trash.net) wrote:
>>> Yup, connector is very async at that place, but I wonder why the hell I
>>> ever made that decision. I believe we can replace it with pure sync call
>>> of the registered connector callback, since netlink is synchronous and
>>> no one has any problem with it.
>>
>> Are you going to do this or do you want me to take care of it?
> 
> I will return back at the end of the week and will take care of this
> problem. I will not mind if you complete it first though :)

Thanks Evgeniy, I'll give it a shot.
```

## Re: \[Drbd-dev\] \[PATCH 2/2 v2\] netlink: kill eff\_cap from struct netlink\_skb\_parms

- From: Evgeniy Polyakov \<hidden\>
- Date: 2011-03-17 15:43:07 
- Message: https://ratatoskr.run/linux-fbdev/2011/03/10866815.md

```text
Hi.

On Tue, Mar 08, 2011 at 07:54:33PM +0100, Patrick McHardy (kaber@trash.net) wrote:
> >> Are you going to do this or do you want me to take care of it?
> > 
> > I will return back at the end of the week and will take care of this
> > problem. I will not mind if you complete it first though :)
> 
> Thanks Evgeniy, I'll give it a shot.

Is my help needed there or you will clean things up?

-- 
	Evgeniy Polyakov
```
