-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
treewide: Fix unsafe concatenation of $LD_LIBRARY_PATH #76804
Conversation
"LD_LIBRARY_PATH=${cudaStub}\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} "; | ||
"LD_LIBRARY_PATH=${cudaStub}\${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This one is a no-op just to match the more common style, so that real problems can be found more reliably by grepping for :$LD_LIBRARY_PATH
and $LD_LIBRARY_PATH:
.)
This will cause mass-rebuild so it should target staging. |
624523d
to
d0b29cf
Compare
It is generated by https://github.com/NixOS/cabal2nix. Please file an issue on that repo if things aren't being generated correctly. (It looks like maybe something isn't being escaped correctly?) |
Naive concatenation of $LD_LIBRARY_PATH can result in an empty colon-delimited segment; this tells glibc to load libraries from the current directory, which is definitely wrong, and may be a security vulnerability if the current directory is untrusted. (See NixOS#67234, for example.) Fix this throughout the tree. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
d0b29cf
to
b0c846b
Compare
@cdepillabout Thanks, I’ve removed that change and opened NixOS/cabal2nix#438. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff LGTM
The LD_LIBRARY_PATH update from 3cd8ce3 causes opencc to stop building. See also: NixOS#76804
Naive concatenation of $LD_LIBRARY_PATH can result in an empty colon-delimited segment; this tells glibc to load libraries from the current directory, which is definitely wrong, and may be a security vulnerability if the current directory is untrusted. This particular case probably has no security relevance, but we should avoid this unsafe pattern anyway in case it gets copied. See NixOS#76804. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Naive concatenation of $LD_LIBRARY_PATH can result in an empty colon-delimited segment; this tells glibc to load libraries from the current directory, which is definitely wrong, and may be a security vulnerability if the current directory is untrusted. (See NixOS#67234, for example.) Fix this throughout the tree. Followup to NixOS#76804. Fixes NixOS#144646. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Motivation for this change
Naive concatenation of
$LD_LIBRARY_PATH
can result in an empty colon-delimited segment; this tells glibc to load libraries from the current directory, which is definitely wrong, and may be a security vulnerability if the current directory is untrusted. (See #67234, for example.) Fix this throughout the tree.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @