Closed Bug 1833965 Opened 2 years ago Closed 1 year ago

pkix_List_Duplicate() consumes too much stack memory with recursion and causes a crash if used with small stacks.

Categories

(NSS :: Libraries, defect)

3.49
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dodo_birds, Unassigned)

Details

Attachments

(1 file)

Steps to reproduce:

Call pkix_List_Duplicate() on a large list(a few thousand) from a thread with a small stack(maybe 8k or 16k).

Actual results:

pkix_List_Duplicate() will attempt to recursively copy all of the elements in the list. However, it will run out of stack memory and cause a crash.

This is causing an issue on an embedded system with limited memory. The system that is encountering the issue is currently using NSS version 3.49.1 and NSPR version 4.24.

Expected results:

pkix_List_Duplicate() should successfully copy all of the elements without running out of stack memory.

Attached is a diff that converts the function from recursive to iterative. This resolves the issue for the scenario described above.

The severity field is not set for this bug.
:beurdouche, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(bbeurdouche)

@Dana, any opinion on what to do with this since it is in libpkix ?

Flags: needinfo?(bbeurdouche) → needinfo?(dkeeler)

I'd WONTFIX this. We shouldn't spend any time on libpkix.

Flags: needinfo?(dkeeler)

Agreed, Thank you !

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: