Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3196022imu; Mon, 17 Dec 2018 15:16:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xs00qfMG7uC1oOaNs0URHIlw8AWhI8G5RyfmIleAPXMrr9adqqJTZTvYDtt/xPRKW6dYf6 X-Received: by 2002:a17:902:6502:: with SMTP id b2mr14174452plk.44.1545088592153; Mon, 17 Dec 2018 15:16:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545088592; cv=none; d=google.com; s=arc-20160816; b=ZZiux5We4zbJONlEBggNXGsLnM5Y4HJioWKlikCZmxmxEp8lUMsCGVkBPpVwoqqbR4 K+vreQqarkMfpPsXVBgrj7fLZnP/vABO5PrHWeO966jglYczoL3Kq8sB2HzQlQIW5IEt uAAJCl4tmoG0t6kxwbsbHMYkNnX3BuSGOeFnZbolrtL4HqagaGk6XIU5e+48wdk9ggRJ /HfPVFnK01XSyhkYqAwCJgiQQ0ebBSUPFCaEfvkmoEE+vmo7gaCfLUApFCRIbBpjO2pz MoXHYFBb4+kZOo+/rUuhaLW+0M0Zcx03ZBNbNJEKhHyejqmDiPInlM5yjgidALVZ+U/e ouDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hUCDd1qVR7zra0gSo/zsbGu0tuzqW9bjcUU103oLgIw=; b=lqh/ersZqie0EMzRi4F2loLR9TxMcE+XCMy1T1JHPCptHYF1gPMfUQ5k77LaRsO9EX DA+UwPKjJV51126Rxi/vwb4P1wJ21wansa70BbaE07Vrl2VBs+5lgQojOFsY8IKYJThD ro3ayz4QQf+jED7SsgaMX5zz8gp9wXqBdd8a1f2hrxP5gDoH3oZzXhJe7K08NogvGUI5 ZS5Ud7u5AJBehaOF5qAc2gZgW3uJYvXtl2AtnIg1UyrIJ/0iytFW31NQAmc2h6aSer02 X7cOkp5F2NuzeJ/lkydCjQisu7pjjjrUa6LbfIMhUhab7Kxx6f/QrYrSO6lme2ckwSoN pBdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=AhLXP7nc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15si12361278pgq.378.2018.12.17.15.16.17; Mon, 17 Dec 2018 15:16:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=AhLXP7nc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389221AbeLQSuU (ORCPT + 99 others); Mon, 17 Dec 2018 13:50:20 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:36603 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727819AbeLQSuU (ORCPT ); Mon, 17 Dec 2018 13:50:20 -0500 Received: by mail-lj1-f196.google.com with SMTP id g11-v6so11971683ljk.3 for ; Mon, 17 Dec 2018 10:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hUCDd1qVR7zra0gSo/zsbGu0tuzqW9bjcUU103oLgIw=; b=AhLXP7nc+oqTGaEt2DtKQyFN9pPdd63bF0SeX9hPGdzqoLVSGib4VXXJ+aTIztLOlQ ZrBDjsSbgKb9G1dNBOk4O7Ps6K9qJHnQFy/1NsK2j76fjR/fxixUrfJuna9/AK7mdCZ/ gizOWY37n5WoZDP9IA0rzmXoVn/MEN78JQcWA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hUCDd1qVR7zra0gSo/zsbGu0tuzqW9bjcUU103oLgIw=; b=W9a+N3hugET4bRiKPPWzF+/0IgrJkUIyup/vZGKZdeQuJdnM1ygiYuUdXNr04NBTX2 kLiSOks4jBwQ49tSgOHV9ELtv2dDCem5s2NCxt0t9plP4B7bAqIdyZ3QO7l21ff9Y7nx 5AruWZGRCXuTDJ5lrfrHaI+mQTqZcdAXZMTj2lrAjlo1ohW+oQuij/3HLBQz0Ltp9caK jerR/G7odTM9m8jtehPxPSynMuQoWMVH9voEatqS76QUTU8cYPoVGx9G4Uu004T4ylEI Kb+3MLi/1ZNhYfwOgWSQ3jql1eahxPo7uSYLZp9qBnlDm1w7hCBRofpeBYhwW4VJpj2m zTEA== X-Gm-Message-State: AA+aEWYSVrH5PuaeO6oimfIP1w3wrjuXwKe3UL734XLsKaPfDc5rpZ6J CRCwgvhMfhHOUJAexmCzFs2KNMN3Vko= X-Received: by 2002:a2e:9849:: with SMTP id e9-v6mr8261272ljj.9.1545072617810; Mon, 17 Dec 2018 10:50:17 -0800 (PST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id m77sm2807596lfg.3.2018.12.17.10.50.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Dec 2018 10:50:16 -0800 (PST) Received: by mail-lj1-f170.google.com with SMTP id t9-v6so11950923ljh.6 for ; Mon, 17 Dec 2018 10:50:16 -0800 (PST) X-Received: by 2002:a2e:9983:: with SMTP id w3-v6mr8985170lji.133.1545072616266; Mon, 17 Dec 2018 10:50:16 -0800 (PST) MIME-Version: 1.0 References: <20181128232019.GC131170@gmail.com> <20181217181244.220052-1-ebiggers@kernel.org> In-Reply-To: From: Linus Torvalds Date: Mon, 17 Dec 2018 10:49:59 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RESEND] KEYS: fix parsing invalid pkey info string To: ebiggers@kernel.org, James Morris James Morris , Mimi Zohar , Jarkko Sakkinen , Peter Huewe Cc: David Howells , keyrings@vger.kernel.org, Linux List Kernel Mailing , syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 17, 2018 at 10:43 AM Linus Torvalds wrote: > > Or maybe just remove it entirely, since it's clearly entirely > incorrect from the very start. .. or another alternative: remove the "Opt_err = -1" entirely. Again, this seems to be a buggy pattern exclusive to the security code. Nobody else does it, and using that negative value is basically the source of those two bugs. It seems pointless and wrong. So the *simplest* fix would seem to be to literally remove all those "= -1" for the Opt_err initialization. Making the code smaller, simpler, and fixing the bug in the process. Hmm? Linus