#303 closed defect (fixed)

violation of 'node_access' copy semantics

Reported by: strauman Owned by: Jennifer Averett
Priority: normal Milestone: 2
Component: fs Version: unknown
Severity: major Keywords:
Cc: bugs@…, joel.sherrill@… Blocked By:
Blocking:

Description

The 'privateenv' code simply copies the 'current' and 'root' nodes when creating a private environment.
This is illegal, as the node_access field might reference
private FS data who must be properly copied also.
The fix makes such copies and releases them when the task variable associated with the userenv is destroyed.
The patch also DISABLES the 'share_userenv' routine unless the userenv structure is enhanced by a 'refcnt' field. The use of a shared userenv is discouraged (race conditions, refcnt).

The patch also removes the temporary reassignment of the
'current' and 'root' nodes during getpwent() & friends calls. IMO, the race condition resulting as a side effect is not tolerable. It must not be possible for a thread who just reads the password file to implicitely change the root location of everybody.
I'm aware that this may break existing code but IMHO, another (thread-safe) solution needs to be found.

An obvious solution to many of these problems would be a variant of rtems_filesystem_evaluate_path() who can be passed a 'node' pointer as a starting point rather than a character string.

Release:
ss-20020301

Attachments (1)

privateenv.patch (12.2 KB) - added by strauman on Dec 3, 2006 at 1:31:12 PM.
privateenv.patch

Download all attachments as: .zip

Change History (3)

comment:1 Changed on Nov 13, 2002 at 11:08:44 PM by Joel Sherrill

Owner: changed from mayes to jennifer

comment:2 Changed on Jan 3, 2003 at 5:28:16 PM by Jennifer Averett

Status: assignedclosed

State-Changed-From-To: open->closed
State-Changed-Why: applied patch.

Changed on Dec 3, 2006 at 1:31:12 PM by strauman

Attachment: privateenv.patch added

privateenv.patch

Note: See TracTickets for help on using tickets.