Performing verification for oracular.

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

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

ubuntu@oracular-dc:~$ sudo mv /usr/sbin/cifs.upcall /usr/sbin/cifs.upcall.bin
ubuntu@oracular-dc:~$ sudo cp /usr/sbin/cifs.upcall.wrapper 
/usr/sbin/cifs.upcall
ubuntu@oracular-dc:~$ kdestroy
kdestroy: No credentials cache found while destroying cache
ubuntu@oracular-dc:~$ klist
klist: No credentials cache found (filename: /tmp/krb5cc_1000)
ubuntu@oracular-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@oracular-dc:~$ cat valgrind.log 
==1873== Memcheck, a memory error detector
==1873== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1873== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==1873== Command: /usr/sbin/cifs.upcall.bin 819837775
==1873== 
==1874== 
==1874== HEAP SUMMARY:
==1874==     in use at exit: 130 bytes in 1 blocks
==1874==   total heap usage: 6 allocs, 5 frees, 4,750 bytes allocated
==1874== 
==1874== LEAK SUMMARY:
==1874==    definitely lost: 0 bytes in 0 blocks
==1874==    indirectly lost: 0 bytes in 0 blocks
==1874==      possibly lost: 0 bytes in 0 blocks
==1874==    still reachable: 130 bytes in 1 blocks
==1874==         suppressed: 0 bytes in 0 blocks
==1874== Rerun with --leak-check=full to see details of leaked memory
==1874== 
==1874== For lists of detected and suppressed errors, rerun with: -s
==1874== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==1873== 
==1873== HEAP SUMMARY:
==1873==     in use at exit: 7,119 bytes in 21 blocks
==1873==   total heap usage: 770 allocs, 749 frees, 357,151 bytes allocated
==1873== 
==1873== LEAK SUMMARY:
==1873==    definitely lost: 56 bytes in 1 blocks
==1873==    indirectly lost: 0 bytes in 0 blocks
==1873==      possibly lost: 0 bytes in 0 blocks
==1873==    still reachable: 7,063 bytes in 20 blocks
==1873==         suppressed: 0 bytes in 0 blocks
==1873== Rerun with --leak-check=full to see details of leaked memory
==1873== 
==1873== For lists of detected and suppressed errors, rerun with: -s
==1873== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==1873== could not unlink /tmp/vgdb-pipe-from-vgdb-to-1873-by-???-on-???
==1873== could not unlink /tmp/vgdb-pipe-to-vgdb-from-1873-by-???-on-???
==1873== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-1873-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-2.1ubuntu0.2.

I then again moved the valgrind wrapper script into place:

ubuntu@oracular-dc:~$ sudo mv /usr/sbin/cifs.upcall /usr/sbin/cifs.upcall.bin
ubuntu@oracular-dc:~$ sudo cp /usr/sbin/cifs.upcall.wrapper 
/usr/sbin/cifs.upcall
ubuntu@oracular-dc:~$ kdestroy
kdestroy: No credentials cache found while destroying cache
ubuntu@oracular-dc:~$ klist
klist: No credentials cache found (filename: /tmp/krb5cc_1000)
ubuntu@oracular-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@oracular-dc:~$ cat valgrind.log 
==1675== Memcheck, a memory error detector
==1675== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1675== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==1675== Command: /usr/sbin/cifs.upcall.bin 436965008
==1675== 
==1676== 
==1676== HEAP SUMMARY:
==1676==     in use at exit: 130 bytes in 1 blocks
==1676==   total heap usage: 6 allocs, 5 frees, 4,750 bytes allocated
==1676== 
==1676== LEAK SUMMARY:
==1676==    definitely lost: 0 bytes in 0 blocks
==1676==    indirectly lost: 0 bytes in 0 blocks
==1676==      possibly lost: 0 bytes in 0 blocks
==1676==    still reachable: 130 bytes in 1 blocks
==1676==         suppressed: 0 bytes in 0 blocks
==1676== Rerun with --leak-check=full to see details of leaked memory
==1676== 
==1676== For lists of detected and suppressed errors, rerun with: -s
==1676== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==1675== 
==1675== HEAP SUMMARY:
==1675==     in use at exit: 7,063 bytes in 20 blocks
==1675==   total heap usage: 771 allocs, 751 frees, 361,247 bytes allocated
==1675== 
==1675== LEAK SUMMARY:
==1675==    definitely lost: 0 bytes in 0 blocks
==1675==    indirectly lost: 0 bytes in 0 blocks
==1675==      possibly lost: 0 bytes in 0 blocks
==1675==    still reachable: 7,063 bytes in 20 blocks
==1675==         suppressed: 0 bytes in 0 blocks
==1675== Rerun with --leak-check=full to see details of leaked memory
==1675== 
==1675== For lists of detected and suppressed errors, rerun with: -s
==1675== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==1675== could not unlink /tmp/vgdb-pipe-from-vgdb-to-1675-by-???-on-???
==1675== could not unlink /tmp/vgdb-pipe-to-vgdb-from-1675-by-???-on-???
==1675== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-1675-by-???-on-???

This time we don't leak any memory.

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

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

Valid starting     Expires            Service principal
06/16/25 01:49:53  06/16/25 11:49:53  
krbtgt/[email protected]
        renew until 06/17/25 01:49:51
root@oracular-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@oracular-dc:/home/ubuntu# umount /mnt/testshare1
root@oracular-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 | 739.00 KiB/s, done.
Resolving deltas: 100% (28/28), done.
root@oracular-dc:/home/ubuntu# cd python-krb5ccparse/
root@oracular-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@oracular-dc:/home/ubuntu/python-krb5ccparse# kdestroy
root@oracular-dc:/home/ubuntu/python-krb5ccparse# mv /tmp/removed /tmp/krb5cc_0
root@oracular-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:50:02  06/16/25 11:49:53  cifs/samba-dc.example.com@
        renew until 06/17/25 01:49:51
        Ticket server: cifs/[email protected]
root@oracular-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@oracular-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.229,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,reparse=nfs,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 oracular.

** Tags added: verification-done-oracular

-- 
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