lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANq1E4R-yYeCkgD5t4g7BU46CQ5NWAv1xE=ZwWuMcwh_sgm1-A@mail.gmail.com>
Date:	Thu, 4 Jun 2015 08:19:10 +0200
From:	David Herrmann <dh.herrmann@...il.com>
To:	Greg KH <gregkh@...uxfoundation.org>
Cc:	Lukasz Skalski <l.skalski@...sung.com>,
	Daniel Mack <daniel@...que.org>,
	Djalal Harouni <tixxdz@...ndz.org>,
	Sergei Zviagintsev <sergei@...v.net>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] kdbus: do not append the same connection to the queue twice

Hi

On Thu, Jun 4, 2015 at 7:51 AM, Greg KH <gregkh@...uxfoundation.org> wrote:
> On Tue, Apr 14, 2015 at 10:24:53AM +0200, Lukasz Skalski wrote:
>> As it was discussed on systemd ML [1], the same connection should be
>> queued up only once for a given well-known name.
>>
>> [1] http://lists.freedesktop.org/archives/systemd-devel/2015-April/030494.html
>>
>> Signed-off-by: Lukasz Skalski <l.skalski@...sung.com>
>>
>> diff --git a/ipc/kdbus/names.c b/ipc/kdbus/names.c
>> index 657008e..df99e4d 100644
>> --- a/ipc/kdbus/names.c
>> +++ b/ipc/kdbus/names.c
>> @@ -353,10 +353,24 @@ int kdbus_name_acquire(struct kdbus_name_registry *reg,
>>       } else if (flags & KDBUS_NAME_QUEUE) {
>>               /* add to waiting-queue of the name */
>>
>> -             ret = kdbus_name_pending_new(e, conn, flags);
>> -             if (ret >= 0)
>> -                     /* tell the caller that we queued it */
>> -                     rflags |= KDBUS_NAME_IN_QUEUE;
>> +             struct kdbus_name_pending *p;
>> +             bool in_queue = false;
>> +
>> +             list_for_each_entry(p, &e->queue, name_entry) {
>> +                     if (p->conn == conn) {
>> +                             /* connection is already queued */
>> +                             rflags |= KDBUS_NAME_IN_QUEUE;
>> +                             in_queue = true;
>> +                             break;
>> +                     }
>> +             }
>> +
>> +             if (!in_queue) {
>> +                     ret = kdbus_name_pending_new(e, conn, flags);
>> +                     if (ret >= 0)
>> +                             /* tell the caller that we queued it */
>> +                             rflags |= KDBUS_NAME_IN_QUEUE;
>> +             }
>>       } else {
>>               /* the name is busy, return a failure */
>>               ret = -EEXIST;
>
> David, did you miss this patch in your last round of kdbus updates?

I already talked to Lukasz off-list. There are some more changes
required, they'll be included in round #2.

Thanks
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ