From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Biggers Subject: Re: [PATCH net] KEYS: DNS: fix parsing multiple options Date: Mon, 25 Jun 2018 10:37:24 -0700 Message-ID: <20180625173724.GB180889@gmail.com> References: <20180608162037.129802-1-ebiggers3@gmail.com> <8195.1528992870@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, David Howells , keyrings@vger.kernel.org, Wang Lei , Eric Biggers To: "David S . Miller" Return-path: Received: from mail-pg0-f65.google.com ([74.125.83.65]:33313 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934377AbeFYRh1 (ORCPT ); Mon, 25 Jun 2018 13:37:27 -0400 Content-Disposition: inline In-Reply-To: <8195.1528992870@warthog.procyon.org.uk> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Jun 14, 2018 at 05:14:30PM +0100, David Howells wrote: > The fix seems to work, but the use of kstrtoul(): > > ret = kstrtoul(eq, 10, &derrno); > > is incorrect since the buffer can't been modified to block out the next > argument if there is one, so the following fails: > > perl -e 'print "#dnserror=1#", "\x00" x 1' | > keyctl padd dns_resolver desc @s > > (Note this is preexisting and nothing to do with your patch). > > I'm not sure how best to handle this. > > Anyway, Dave, can you take Eric's patch into the net tree with: > > Acked-by: David Howells > > David It could be handled by copying the option value to a temporary buffer. Anyway, that can be a separate fix... David (Miller), are you planning to take this through -net? Thanks! - Eric