[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080530162500.1411f14d.akpm@linux-foundation.org>
Date: Fri, 30 May 2008 16:25:00 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: "Ahmed S. Darwish" <darwish.07@...il.com>
Cc: casey@...aufler-ca.com, paul.moore@...com,
linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH BUGFIX -v2 -rc4] Smack: Respect 'unlabeled' netlabel
mode
On Sat, 31 May 2008 02:57:51 +0300
"Ahmed S. Darwish" <darwish.07@...il.com> wrote:
> + mutex_lock(&smack_ambient_lock);
> + nlsp->domain = kstrdup(smack_net_ambient, GFP_ATOMIC);
> + mutex_unlock(&smack_ambient_lock);
no no no no no. And no.
GFP_ATOMIC is *unreliable*. Using it in a "security" feature is a bug
- if it fails, the feature isn't secure any more.
Failing to check the kmalloc() return value might be a bug.
If we _need_ GFP_ATOMIC here then taking a mutex in a cannot-sleep
context is a bug.
The patch adds a kmalloc but doesn't add a kfree. Is it leaky?
Finally, why is there a need to take a lock around a single store
instruction?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists