RT RT/krbdev.mit.edu: Ticket #6034 rework gic_opt_ext to be more portable Signed in as guest.
[Logout]

[Home] [Search] [Configuration]

[Display] [History] [Basics] [Dates] [People] [Links] [Jumbo]

 
 

 The Basics  
Id
6034
Status
open
Worked
0 min
Priority
0/0
Queue
krb5
 

 Keyword Selections  
Component
  • krb5-libs
Version_reported
Version_Fixed
Target_Version
Tags
 

 Relationships  
Depends on:
Depended on by:
Parents:
Children:

Refers to:
  • 6010: (tlyu) krb5int_gic_opte_copy should copy elements individually [resolved]
Referred to by:
 
 Dates  
Created: Wed Jul 16 16:21:45 2008
Starts: Not set
Started: Not set
Last Contact: Not set
Due: Not set
Updated: Sun Nov 29 16:35:35 2009 by ghudson
 

 People  
Owner
 tlyu
Requestors
 tlyu@mit.edu
Cc
 
AdminCc
 
 

 More about Tom Yu  
Comments about this user:
No comment entered about this user
This user's 25 highest priority tickets:
 

History   Display mode: [Brief headers] [Full headers]
      Wed Jul 16 16:21:46 2008  tlyu - Ticket created    
     
Subject: rework gic_opt_ext to be more portable

krb5_gic_opt_ext is an opaque structure that is supposed to be
binary-compatible with krb5_get_init_creds_opt, but might not conform to
the C standard due to type punning.  Fix this by including a copy of
krb5_get_init_creds_opt as the first member of krb5_gic_opt and doing
all dependent changes.


Download (untitled) 297b
      Wed Jul 16 16:21:49 2008  tlyu - Ticket 6034 RefersTo ticket 6010.    
      Sun Nov 29 16:35:35 2009  ghudson - Comments added    
     
A related problem is that the opt_to_opte contract is not nestable.  If
you pass in an options structure which is already the result of an
opt_to_opte copy, you will get an alias (because the structure is
extended) which looks like a copy (because the shadowed flag was already
set).

It is also hard for a static analysis tool to detect memory leaks
related to opt_to_opte because of its "maybe a copy, maybe an alias"
contract.

These problems can be patched up in a variety of ways (such as by using
a reference count instead of the shadowed flag), but my favorite is to
get rid of the copies entirely.  To do this, we'd pass around pointers
to the unextended options structure everywhere, and use accessor
functions or macros when reading extended options fields.  The accessor
would return a default value if the structure is not extended, and would
cast the pointer to the extended structure and retrieve the field if it is.

I'm making these notes here since both fixes involve visiting every
piece of code which touches an options structure.


Download (untitled) 1k