Discussion:
commit "ITS#8226 limit size of read txns in searches" has a bug
Леонид Юрьев
2015-08-31 11:12:16 UTC
Permalink
Content preview: Hi, Howard. wwctx.txn may be uninitialized, see lines 712-720
of back-mdb/search.c http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=servers/slapd/back-mdb/search.c;h=502312add20f305cb62083a88610aaaf2a2d652c;hb=21bf33b0e8e044d6722a9c3ef4a3961d71465d77#l713
[...]

Content analysis details: (-1.9 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked.
See
http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
for more information.
[URIs: openldap.org]
-0.0 SPF_PASS SPF: sender matches SPF record
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]

Hi, Howard.

wwctx.txn may be uninitialized, see lines 712-720 of back-mdb/search.c
http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=servers/slapd/back-mdb/search.c;h=502312add20f305cb62083a88610aaaf2a2d652c;hb=21bf33b0e8e044d6722a9c3ef4a3961d71465d77#l713

And therefore mdb_rtxn_snap() may segfault when will called from line 1127.
http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=servers/slapd/back-mdb/search.c;h=502312add20f305cb62083a88610aaaf2a2d652c;hb=21bf33b0e8e044d6722a9c3ef4a3961d71465d77#l1127

I think, one of the following should be:
- wwctx should be initialize completely at 712;
or
- an additional condition should be checked at 1123-1125.

Regards,
Leonid.
Howard Chu
2015-08-31 13:57:16 UTC
Permalink
Content preview: Леонид Юрьев wrote: > Hi, Howard. > > wwctx.txn
may be uninitialized, see lines 712-720 of back-mdb/search.c > http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=servers/slapd/back-mdb/search.c;h=502312add20f305cb62083a88610aaaf2a2d652c;hb=21bf33b0e8e044d6722a9c3ef4a3961d71465d77#l713
Post by Леонид Юрьев
Post by Леонид Юрьев
And therefore mdb_rtxn_snap() may segfault when will called from line
1127. > http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=servers/slapd/back-mdb/search.c;h=502312add20f305cb62083a88610aaaf2a2d652c;hb=21bf33b0e8e044d6722a9c3ef4a3961d71465d77#l1127
Post by Леонид Юрьев
Post by Леонид Юрьев
I think, one of the following should be: > - wwctx should be initialize
completely at 712; > or > - an additional condition should be checked at
1123-1125. [...]

Content analysis details: (-1.9 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked.
See
http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
for more information.
[URIs: openldap.org]
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
X-BeenThere: openldap-***@openldap.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: OpenLDAP development discussion list <openldap-devel.openldap.org>
List-Unsubscribe: <http://www.openldap.org/lists/mm/options/openldap-devel>,
<mailto:openldap-devel-***@openldap.org?subject=unsubscribe>
List-Archive: <http://www.openldap.org/lists/openldap-devel/>
List-Post: <mailto:openldap-***@openldap.org>
List-Help: <mailto:openldap-devel-***@openldap.org?subject=help>
List-Subscribe: <http://www.openldap.org/lists/mm/listinfo/openldap-devel>,
<mailto:openldap-devel-***@openldap.org?subject=subscribe>
Errors-To: openldap-devel-***@openldap.org
Sender: "openldap-devel" <openldap-devel-***@openldap.org>
X-Spam-Score: -1.9 (-)
X-Spam-Report: Spam detection software, running on the system "gauss.openldap.net", has
identified this incoming email as possible spam. The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email. If you have any questions, see
the administrator of that system for details.

Content preview: Леонид Юрьев wrote: > Hi, Howard. > > wwctx.txn
may be uninitialized, see lines 712-720 of back-mdb/search.c > http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=servers/slapd/back-mdb/search.c;h=502312add20f305cb62083a88610aaaf2a2d652c;hb=21bf33b0e8e044d6722a9c3ef4a3961d71465d77#l713
Post by Леонид Юрьев
Post by Леонид Юрьев
And therefore mdb_rtxn_snap() may segfault when will called from line
1127. > http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=servers/slapd/back-mdb/search.c;h=502312add20f305cb62083a88610aaaf2a2d652c;hb=21bf33b0e8e044d6722a9c3ef4a3961d71465d77#l1127
Post by Леонид Юрьев
Post by Леонид Юрьев
I think, one of the following should be: > - wwctx should be initialize
completely at 712; > or > - an additional condition should be checked at
1123-1125. [...]

Content analysis details: (-1.9 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked.
See
http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
for more information.
[URIs: highlandsun.com]
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
Post by Леонид Юрьев
Hi, Howard.
wwctx.txn may be uninitialized, see lines 712-720 of back-mdb/search.c
http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=servers/slapd/back-mdb/search.c;h=502312add20f305cb62083a88610aaaf2a2d652c;hb=21bf33b0e8e044d6722a9c3ef4a3961d71465d77#l713
And therefore mdb_rtxn_snap() may segfault when will called from line 1127.
http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=servers/slapd/back-mdb/search.c;h=502312add20f305cb62083a88610aaaf2a2d652c;hb=21bf33b0e8e044d6722a9c3ef4a3961d71465d77#l1127
- wwctx should be initialize completely at 712;
or
- an additional condition should be checked at 1123-1125.
Thanks, you're right. If the current operation doesn't own the transaction
(e.g. search called while evaluating the ACL in some other operation) then it
must leave the transaction alone. Fixed now.
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/
Loading...