[SRU] Memory leak in krb5 version 1.17
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
krb5 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Ponnuvel Palaniyappan |
Bug Description
[ Impact ]
Commit https:/
altered the memory management of krb5_gss_
an owner pointer when the function must acquire a default credential.
The commit neglected to update the code to release the default cred
along the successful path. The old code does not trigger because
cred_handle is now reassigned, so the default credential is leaked.
Resulting gradual increase in memory usage (memory leak) and eventual crash.
[ Test Plan ]
Setup 3 VMs:
1. Windows Server act as Domain controller (AD)
2. Windows machine AD Joined with Ostress installed. (Ostress is part of RML utilities https:/
3. SQL on Linux AD Joined ( configuration steps https:/
On the Machine with OStress create a file (name it disconnect.ini) with the following content under the same folder “C:\Program Files\Microsoft Corporation\
disconnect.ini
==============
[Connection Options]
LoginTimeout=30
QuotedIdentifie
AutocommitMode=On
DisconnectPct=100.0
MaxThreadErrors=0
[Query Options]
NoSQLBindCol=Off
NoResultDisplay=Off
PrepareExecute=Off
ExecuteAsync=Off
RollbackOnCance
QueryTimeout=0
QueryDelay=0
MaxRetries=0
BatchDisconnect
CancelPct=0.00
CancelDelay=0
CancelDelayMin=0
CursorType=
CursorConcurrency=
RowFetchDelay=0
[Replay Options]
Sequencing Options=global sequence
::Sequencing Options=global sequence, dtc replay
DTC Timeout=
DTC Machine=(local)
Playback Coordinator=(local)
StartSeqNum=
StopSeqNum=
TimeoutFactor=1.0
Run the following command to start the load using Ostress, change Server name (-S) accordingly and the number of threads (-n) as needed.
Start 4 different CMD consoles and use the following different commands for each CMD window:
1. ostress.exe -E -S<ServerName/port> -Q"select * from sys.all_objects" -q -cdisconnect.ini -n40 -r9999999 -oc:\temp\log01 -T146
2. ostress.exe -E -S<ServerName/port> -Q"select * from sys.all_views" -q -cdisconnect.ini -n40 -r9999999 -oc:\temp\log02 -T146
3. ostress.exe -E -S<ServerName/port> -Q"select * from sys.all_columns" -q -cdisconnect.ini -n40 -r9999999 -oc:\temp\log03 -T146
4. ostress.exe -E -S<ServerName/port> -Q"select * from sys.all_parameters" -q -cdisconnect.ini -n40 -r9999999 -oc:\temp\log04 -T146
After a run of about 5 hours, the memory usage for this is expected to be around 5G with the fix.
Without the fix, it was observed that it reached around ~22G in 5 hours. Hence the increase in
memory usage can be observed if the ostress.exe programs are let to run longer.
[ Where problems could occur ]
The fix may not fix the memory leak or could result in releasing the memory
early in a different code path, and thus resulting in crashes.
A mitigating fact is that the fix has been in Ubuntu since at least 22.04 and
they do not exhibit any issues.
Likewise I've previously provided the fix in a PPA https:/
to user who's been hit by this issue. They've tested and confirmed it fixes the memory leak.
[ Other Info ]
The commit https:/
The fix has been included in newer krb5 releases (Jammy, and Noble have the releases with the fix).
Bionic doesn't have the commit the introduced the memory leak in the first place.
So this will be a Focal-only backport.
tags: | added: sts |
Changed in krb5 (Ubuntu Focal): | |
assignee: | nobody → Ponnuvel Palaniyappan (pponnuvel) |
Changed in krb5 (Ubuntu): | |
status: | New → Fix Released |
Changed in krb5 (Ubuntu Focal): | |
status: | New → In Progress |
description: | updated |
summary: |
- Memory leak in krb5 version 1.17 + [SRU] Memory leak in krb5 version 1.17 |
Hi Ponnuvel,
I see you prepared a debdiff to fix this issue, if you are seeking for a sponsor for you package you could use the Patch Pilot program [1]. Long story short, you could subscribe ~ubuntu-sponsors to this bug and it would go to the Patch Pilot queue.
This is in the Server team queue, and once we have time we will take a look if no one else had already done that. It may take some time.
[1] https:/ /ubuntu. com/community/ contribute/ ubuntu- development/ ubuntu- patch-pilots