Performing verification for noble.

I installed cifs-utils 2:7.0-2ubuntu0.1 from noble -updates.

I followed the testcase and installed valgrind and moved the wrapper script
into place:

ubuntu@noble-dc:~$ sudo mv /usr/sbin/cifs.upcall /usr/sbin/cifs.upcall.bin
ubuntu@noble-dc:~$ sudo cp /usr/sbin/cifs.upcall.wrapper /usr/sbin/cifs.upcall
ubuntu@noble-dc:~$ kdestroy
kdestroy: No credentials cache found while destroying cache
ubuntu@noble-dc:~$ klist
klist: No credentials cache found (filename: /tmp/krb5cc_1000)
ubuntu@noble-dc:~$ sudo mount -t cifs -o sec=krb5i //samba-dc.example.com/demo 
/mnt/testshare1
mount error(126): Required key not available
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log 
messages (dmesg)
ubuntu@noble-dc:~$ cat valgrind.log 
==1469== Memcheck, a memory error detector
==1469== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==1469== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==1469== Command: /usr/sbin/cifs.upcall.bin 1000265621
==1469== 
==1470== 
==1470== HEAP SUMMARY:
==1470==     in use at exit: 130 bytes in 1 blocks
==1470==   total heap usage: 6 allocs, 5 frees, 4,750 bytes allocated
==1470== 
==1470== LEAK SUMMARY:
==1470==    definitely lost: 0 bytes in 0 blocks
==1470==    indirectly lost: 0 bytes in 0 blocks
==1470==      possibly lost: 0 bytes in 0 blocks
==1470==    still reachable: 130 bytes in 1 blocks
==1470==         suppressed: 0 bytes in 0 blocks
==1470== Rerun with --leak-check=full to see details of leaked memory
==1470== 
==1470== For lists of detected and suppressed errors, rerun with: -s
==1470== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==1469== 
==1469== HEAP SUMMARY:
==1469==     in use at exit: 3,690 bytes in 13 blocks
==1469==   total heap usage: 756 allocs, 743 frees, 353,517 bytes allocated
==1469== 
==1469== LEAK SUMMARY:
==1469==    definitely lost: 56 bytes in 1 blocks
==1469==    indirectly lost: 0 bytes in 0 blocks
==1469==      possibly lost: 0 bytes in 0 blocks
==1469==    still reachable: 3,634 bytes in 12 blocks
==1469==         suppressed: 0 bytes in 0 blocks
==1469== Rerun with --leak-check=full to see details of leaked memory
==1469== 
==1469== For lists of detected and suppressed errors, rerun with: -s
==1469== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==1469== could not unlink /tmp/vgdb-pipe-from-vgdb-to-1469-by-???-on-???
==1469== could not unlink /tmp/vgdb-pipe-to-vgdb-from-1469-by-???-on-???
==1469== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-1469-by-???-on-???

We leaked 56 bytes of memory.

I then enabled -security-proposed by this ppa:

https://launchpad.net/~ubuntu-security-
proposed/+archive/ubuntu/ppa/+packages?field.name_filter=cifs-
utils&field.status_filter=published&field.series_filter=

I installed cifs-utils 2:7.0-2ubuntu0.2.

I then again moved the valgrind wrapper script into place:

ubuntu@noble-dc:~$ sudo mv /usr/sbin/cifs.upcall /usr/sbin/cifs.upcall.bin
ubuntu@noble-dc:~$ sudo cp /usr/sbin/cifs.upcall.wrapper /usr/sbin/cifs.upcall
ubuntu@noble-dc:~$ kdestroy
kdestroy: No credentials cache found while destroying cache
ubuntu@noble-dc:~$ klist
klist: No credentials cache found (filename: /tmp/krb5cc_1000)
ubuntu@noble-dc:~$ sudo mount -t cifs -o sec=krb5i //samba-dc.example.com/demo 
/mnt/testshare1
mount error(126): Required key not available
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log 
messages (dmesg)
ubuntu@noble-dc:~$ cat valgrind.log 
==2045== Memcheck, a memory error detector
==2045== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==2045== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==2045== Command: /usr/sbin/cifs.upcall.bin 747771501
==2045== 
==2046== 
==2046== HEAP SUMMARY:
==2046==     in use at exit: 130 bytes in 1 blocks
==2046==   total heap usage: 6 allocs, 5 frees, 4,750 bytes allocated
==2046== 
==2046== LEAK SUMMARY:
==2046==    definitely lost: 0 bytes in 0 blocks
==2046==    indirectly lost: 0 bytes in 0 blocks
==2046==      possibly lost: 0 bytes in 0 blocks
==2046==    still reachable: 130 bytes in 1 blocks
==2046==         suppressed: 0 bytes in 0 blocks
==2046== Rerun with --leak-check=full to see details of leaked memory
==2046== 
==2046== For lists of detected and suppressed errors, rerun with: -s
==2046== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==2045== 
==2045== HEAP SUMMARY:
==2045==     in use at exit: 3,634 bytes in 12 blocks
==2045==   total heap usage: 757 allocs, 745 frees, 357,613 bytes allocated
==2045== 
==2045== LEAK SUMMARY:
==2045==    definitely lost: 0 bytes in 0 blocks
==2045==    indirectly lost: 0 bytes in 0 blocks
==2045==      possibly lost: 0 bytes in 0 blocks
==2045==    still reachable: 3,634 bytes in 12 blocks
==2045==         suppressed: 0 bytes in 0 blocks
==2045== Rerun with --leak-check=full to see details of leaked memory
==2045== 
==2045== For lists of detected and suppressed errors, rerun with: -s
==2045== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==2045== could not unlink /tmp/vgdb-pipe-from-vgdb-to-2045-by-???-on-???
==2045== could not unlink /tmp/vgdb-pipe-to-vgdb-from-2045-by-???-on-???
==2045== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-2045-by-???-on-???

This time we don't leak any memory.

Now I am just running through the testcase of bug 2099917:

root@noble-dc:/home/ubuntu# kinit [email protected]
Password for [email protected]: 
Warning: Your password will expire in 25 days on Sat Jul 12 01:54:39 2025
root@noble-dc:/home/ubuntu# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: [email protected]

Valid starting     Expires            Service principal
06/16/25 01:55:54  06/16/25 11:55:54  
krbtgt/[email protected]
        renew until 06/17/25 01:55:52
root@noble-dc:/home/ubuntu# mount -t cifs -o 
cruid=root,user=root,sec=krb5i,uid=0,gid=0,cred=/tmp/krb5cc_0 
//samba-dc.example.com/demo /mnt/testshare1
root@noble-dc:/home/ubuntu# umount /mnt/testshare1
root@noble-dc:/home/ubuntu# git clone 
https://git.nullroute.lt/hacks/python-krb5ccparse.git
Cloning into 'python-krb5ccparse'...
remote: Enumerating objects: 59, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (59/59), done.
remote: Total 59 (delta 28), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (59/59), 11.55 KiB | 788.00 KiB/s, done.
Resolving deltas: 100% (28/28), done.
root@noble-dc:/home/ubuntu# cd python-krb5ccparse/
root@noble-dc:/home/ubuntu/python-krb5ccparse# ./kremovetkt -c /tmp/krb5cc_0 -o 
/tmp/removed -p krbtgt/[email protected]
Keeping ticket for 
krb5_ccache_conf_data/fast_avail/krbtgt/[email protected]@X-CACHECONF:
Keeping ticket for 
krb5_ccache_conf_data/pa_type/krbtgt/[email protected]@X-CACHECONF:
Skipping ticket for krbtgt/[email protected]
Keeping ticket for cifs/samba-dc.example.com@
root@noble-dc:/home/ubuntu/python-krb5ccparse# kdestroy
root@noble-dc:/home/ubuntu/python-krb5ccparse# mv /tmp/removed /tmp/krb5cc_0
root@noble-dc:/home/ubuntu/python-krb5ccparse# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: [email protected]

Valid starting     Expires            Service principal
06/16/25 01:56:04  06/16/25 11:55:54  cifs/samba-dc.example.com@
        renew until 06/17/25 01:55:52
        Ticket server: cifs/[email protected]
root@noble-dc:/home/ubuntu/python-krb5ccparse# mount -t cifs -o 
cruid=root,user=root,sec=krb5i,uid=0,gid=0,cred=/tmp/krb5cc_0 
//samba-dc.example.com/demo /mnt/testshare1
root@noble-dc:/home/ubuntu/python-krb5ccparse# mount -l
...
//samba-dc.example.com/demo on /mnt/testshare1 type cifs 
(rw,relatime,vers=3.1.1,sec=krb5i,cruid=0,cache=strict,username=root,uid=0,forceuid,gid=0,forcegid,addr=192.168.122.248,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1)

The testcase still holds, and the new package doesn't introduce any
regressions.

The package in -security-proposed fixes the issue. Happy to mark
verified for noble.

** Tags added: verification-done-noble

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2113906

Title:
  Regression: After LP2099917 cifs.upcall leaks memory on error message
  if service ticket doesn't exist

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cifs-utils/+bug/2113906/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to