[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170401162419.sl4keqsb53zll6wf@thunk.org>
Date: Sat, 1 Apr 2017 12:24:19 -0400
From: Theodore Ts'o <tytso@....edu>
To: Joe Richey <joerichey94@...il.com>
Cc: linux-ext4@...r.kernel.org, Michael Halcrow <mhalcrow@...gle.com>,
Joe Richey <joerichey@...gle.com>
Subject: Re: [PATCH] misc: fixed error handling in e4crypt
On Mon, Mar 20, 2017 at 08:34:36PM +0000, Joe Richey wrote:
> + if (keyring_id == KEY_SPEC_SESSION_KEYRING) {
> + keyring_id = keyctl(KEYCTL_GET_KEYRING_ID, keyring_id, 0);
> + if (keyring_id < 0)
> + printf("Could not get session keyring.\n");
> + }
> rc = add_key(EXT2FS_KEY_TYPE_LOGON, key_ref_full, (void *)&key,
> sizeof(key), keyring_id);
Are you sure this is right? If keyring_id is negative, we'll print
the warning/error message --- and then pass the negative keyring_id to
add_key. Is that going to do the right thing?
- Ted
Powered by blists - more mailing lists