cperciva / imds-filterd Goto Github PK
View Code? Open in Web Editor NEWIntercepts and filters requests to the EC2 Instance Metadata Service
License: Other
Intercepts and filters requests to the EC2 Instance Metadata Service
License: Other
Is it possible to block root from within a jail? Or is a root user in jail not considered root by this tool?
imds-filterd/netconfig.c
, line 88:
/* Which address type is this? */
if ((i = ffs(rt->rtm_addrs & ((-1) << i))) == 0) {
warn0("Routing message contains wrong number of addresses!");
goto err0;
}
I believe that (-1) << i
is undefined in C99. The spec says:
C99 draft, 6.5.7 Bitwise shift operators
..
4. The result of E1 << E2 is E1 left-shifted E2 bit positions... If E1 has a signed
type and nonnegative value, and E1 × 2^{E2} is representable in the result type, then that is
the resulting value; otherwise, the behavior is undefined.
One fix might be to change (-1)
to ((size_t)-1)
, but I see that struct rt_msghrd
contains int rtmaddrs
. So maybe the whole line should be
if ((i = ffs(rt->rtm_addrs & (int)(((size_t)-1) << i))) == 0) {
But I've never worked with man 4 route
before, nor do I have a good sense of what that code is doing, so I figured that I'd leave it to you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.