[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1289525049.5167.82.camel@dan>
Date: Thu, 11 Nov 2010 20:24:09 -0500
From: Dan Rosenberg <drosenberg@...curity.com>
To: Thomas Graf <tgraf@...radead.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Oliver Hartkopp <socketcan@...tkopp.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
Urs Thuermann <urs.thuermann@...kswagen.de>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Patrick McHardy <kaber@...sh.net>,
James Morris <jmorris@...ei.org>,
Remi Denis-Courmont <remi.denis-courmont@...ia.com>,
"Pekka Savola (ipv6)" <pekkas@...core.fi>,
Sridhar Samudrala <sri@...ibm.com>,
Vlad Yasevich <vladislav.yasevich@...com>,
Tejun Heo <tj@...nel.org>,
Eric Dumazet <eric.dumazet@...il.com>,
Li Zefan <lizf@...fujitsu.com>, Joe Perches <joe@...ches.com>,
Stephen Hemminger <shemminger@...tta.com>,
Jamal Hadi Salim <hadi@...atatu.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Alexey Dobriyan <adobriyan@...il.com>,
Jiri Pirko <jpirko@...hat.com>,
Johannes Berg <johannes.berg@...el.com>,
Daniel Lezcano <daniel.lezcano@...e.fr>,
Pavel Emelyanov <xemul@...nvz.org>,
socketcan-core@...ts.berlios.de, netdev@...r.kernel.org,
linux-sctp@...r.kernel.org
Subject: Re: [PATCH 3/10] Fix leaking of kernel heap addresses in net/
>
> If we really have to do this. At least don't duplicate all this code. Do
> the check in the printf argument:
>
> seq_printf(seq, "%4d: %08X:%04X %08X:%04X"
> ...
> capable(CAP_NET_ADMIN) ? sp : 0,
>
> I would even move the decision whether to expose kernel addresses or not
> to a function so we can change behavior in one place.
I wrote it this way because the format specifier must also be changed,
or the %p output will print "(null)", which cannot be parsed by
userspace programs expecting "(nil)" or 0. I could include another
check inside the format specifier, but that seemed pretty ugly. But
then again, it's ugly either way.
-Dan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists