bugacl - Bugs: bug #50566, Uninitialized value in lt-setfacl

 
 

bug #50566: Uninitialized value in lt-setfacl

Submitted by:  None
Submitted on:  Fri 17 Mar 2017 06:34:55 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 17 May 2017 04:52:04 PM UTC, comment #4:

Oops, forgot to post link to that bug report: https://bugzilla.redhat.com/1451801

Kamil Dudka <kdudka>
Wed 17 May 2017 04:45:50 PM UTC, comment #3:

Note that the commit message is not accurate. We have a real bug report about acl_check() failing on setfacl --restore and the bug is effectively fixed by this commit.

Kamil Dudka <kdudka>
Fri 17 Mar 2017 09:31:24 AM UTC, comment #2:

Thanks. Luckily, the uninitialized memory accesses have no effect in this particular case: backups always contain explicit mask entries; the execute permissions that are compute dunconditionally are not used in this case. I've pushed a fix for shutting up valgrind anyway, though.

Andreas Gruenbacher <agruen>
Project Administrator
Fri 17 Mar 2017 06:48:59 AM UTC, comment #1:

Similarly, uninitilized c_perm is read and acted upon:

mode_t perm = cmd->c_perm;
...
/* Check for `X', and replace with `x' as appropriate. */
if (perm & CMD_PERM_COND_EXECUTE) {

Anonymous
Fri 17 Mar 2017 06:34:55 AM UTC, original submission:

Restore() function in setfacl.c adds default initial commands to command sequence:
if (seq_append_cmd(args.seq, CMD_REMOVE_ACL, ACL_TYPE_ACCESS) ||
seq_append_cmd(args.seq, CMD_REMOVE_ACL, ACL_TYPE_DEFAULT))
goto fail_errno;

But seq_append_cmd() only initializes c_cmd and c_type fields, which later triggers uninitialized memory access to c_tag field in do_set():
if (cmd->c_tag == ACL_MASK)
acl_mask_provided = 1;

~/src/acl$ echo '# file: d' > d.acl
~/src/acl$ valgrind --trace-children=yes --track-origins=yes ./setfacl --restore d.acl
...
==12306== Conditional jump or move depends on uninitialised value(s)
==12306== at 0x402DE9: do_set (do_set.c:305)
==12306== by 0x4048FD: restore (setfacl.c:188)
==12306== by 0x402220: main (setfacl.c:578)
==12306== Uninitialised value was created by a heap allocation
==12306== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12306== by 0x404565: cmd_init (sequence.c:33)
==12306== by 0x404565: seq_append_cmd (sequence.c:102)
==12306== by 0x404879: restore (setfacl.c:163)
==12306== by 0x402220: main (setfacl.c:578)

This issue has been found using Valgrind and https://github.com/yugr/debian_pkg_test

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by kdudka (Posted a comment)
  • -unavailable- added by agruen (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 17 Mar 2017 09:31:51 AM UTCagruenOpen/ClosedOpen=>Closed
    Fri 17 Mar 2017 09:31:24 AM UTCagruenStatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1