[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090216120204.44f78aa2.akpm@linux-foundation.org>
Date: Mon, 16 Feb 2009 12:02:04 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Johannes Weiner <hannes@...xchg.org>
Cc: Pekka Enberg <penberg@...helsinki.fi>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Tyler Hicks <tyhicks@...ux.vnet.ibm.com>
Subject: Re: [patch 7/8] ecryptfs: use kzfree()
On Mon, 16 Feb 2009 15:29:33 +0100 Johannes Weiner <hannes@...xchg.org> wrote:
> --- a/fs/ecryptfs/keystore.c
> +++ b/fs/ecryptfs/keystore.c
> @@ -740,8 +740,7 @@ ecryptfs_write_tag_70_packet(char *dest,
> out_release_free_unlock:
> crypto_free_hash(s->hash_desc.tfm);
> out_free_unlock:
> - memset(s->block_aligned_filename, 0, s->block_aligned_filename_size);
> - kfree(s->block_aligned_filename);
> + kzfree(s->block_aligned_filename);
> out_unlock:
> mutex_unlock(s->tfm_mutex);
> out:
> --- a/fs/ecryptfs/messaging.c
> +++ b/fs/ecryptfs/messaging.c
> @@ -291,8 +291,7 @@ int ecryptfs_exorcise_daemon(struct ecry
> if (daemon->user_ns)
> put_user_ns(daemon->user_ns);
> mutex_unlock(&daemon->mux);
> - memset(daemon, 0, sizeof(*daemon));
> - kfree(daemon);
> + kzfree(daemon);
> out:
> return rc;
> }
Except for this one and the crypto one, which might have been done for
security reasons.
Even though both of them forgot to add a comment explaining this, which
is bad, wrong, stupid and irritating. Sigh.
--
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