Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3805446imu; Tue, 18 Dec 2018 04:36:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/XJ3oWmAUkQHQYKvJZEd8ONX+hOHEjZZksqrssmfOe5a/tO2+//qBNTZibJkTd5LG+aRJIb X-Received: by 2002:a17:902:7481:: with SMTP id h1mr16515189pll.341.1545136561891; Tue, 18 Dec 2018 04:36:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545136561; cv=none; d=google.com; s=arc-20160816; b=cxvndNLZIvyozkGRjeGlaufxOSdn5wI9l2bZlLpRfAUnyOib7DNSUaQ6LbXMSYwEPP Wf5iE/AaxSkbOZMd4SQO6JneaitV0AEIBbMXdCIv9nhQirtOlFtU4/jP4XpvIdxLndjU sB1jWYNfMxxkP9qB1UUoFCE2BSQqwZ6njt2GbU7chDf7TCBamXNlMF2abjIkjUq8HGN7 PLkgK1T870RL/9V4LGs7lIDxz0CsE7GabsEO4PFDWplV+cFjGLAm92Vns+vGBg4S7j+C qnUZ1OiLaqA3FnwpWKfZoFQ7pdi/tK7b3tplIzCjvxZ8DpCcwXvSO5BsyfRfiH0r95bu /DTg== 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=eXDNPof5uV3UGislf87gb1NcbfYgNg3HRg2PaytvV28=; b=lzEqqS5myPvxZ60m6f/Hcap0P9u4DKrIOhjHML+nU4hrcmCsw5cv7H8e/kjGN+/A8M weEii5XPJ4CLpxo3Fy/2CI2HvGupgVJp4HUZd+H4ZljtJb5nLJOeaI9AU11gyKFl8MpA 0IKwHSUtowcuYPro0IGqbxvjPytnziQz9//Glr+R4thKoY5CzO1eykoydaMQidUcfFq2 HCJHRr2LN/S5Ak9/1q1OfcEcYXA1aZ3qd8Ao8lmBHGji6MnGYtjaHmV7YXtcVavOBBar dkrLFBs+M3XkyRIL4rwdxoDo1dkhfFeL1ndlqI2IeNuAw2QCwixMstFY+AC6VOYTA1/v qORA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=k4fmE9zW; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si12774980plz.233.2018.12.18.04.35.46; Tue, 18 Dec 2018 04:36:01 -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=@google.com header.s=20161025 header.b=k4fmE9zW; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726638AbeLRMeU (ORCPT + 99 others); Tue, 18 Dec 2018 07:34:20 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:50610 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726403AbeLRMeT (ORCPT ); Tue, 18 Dec 2018 07:34:19 -0500 Received: by mail-it1-f195.google.com with SMTP id z7so3874238iti.0 for ; Tue, 18 Dec 2018 04:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eXDNPof5uV3UGislf87gb1NcbfYgNg3HRg2PaytvV28=; b=k4fmE9zWVZwGlFkkIBjCWhcdOxlDBjuF88zXyorjwYmUCcUAH3019S0PKZSxRHK+/b FyLQXnpu8+1ooHaiNLNgxqiseZJoAqh1Di7Pv1EA0YKykXzxujkWdaUukPCdN3GENGjN hFkKLRoDV5zsaJ5uq7WQN7bGtqF3Ho8B8y+0Mz4yg9+J8I5wrtRXs59BULWZkWBAoWd/ 8K3vZ4VmFqiNpaYi6xCuuIIQZkBNcnF09j6J6DfVTUii9ceXzN4jum0F7cRwmN3MlWr+ +AywuAKj2lNA9eaj5dsMShuF77LwZOLWczIIyIutKFZmHTenPHp11VH3pPEF4AKjINCP Mj2Q== 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=eXDNPof5uV3UGislf87gb1NcbfYgNg3HRg2PaytvV28=; b=noydg0kOclYmvUEuV3ScvI2g1EZFwsjiqtuSZI1ZwihJCpr+YLdZl8mpg1MgNpCo1Z xyh39cqAPZOIFYdH5hl1G56qcahIkRdwH+pmhTqftuRxeO0B9K3GQ7MFviY0ttGeQA8l XkKhkCNrajtnaiwfAl/tRfwjHszTUj2LLjBfHvWNsfmZu39k9fuaxoRCDqjMVFn/dzAz hRMA3rSPxX/TJtZAnVMz8l10QdvEti661KlYC8IC64SBo9Jt8dPtGRjrzRJ3pkQFwKYl 65GlzdmhtKlxzaWzuyY1O1Uad0sh9Wj3G7OtQWYCYRlvqCkEYoOno/holRUhNFnEkiY4 YjZg== X-Gm-Message-State: AA+aEWbjuD7FhaUKGSCnI6HWe+7GplgXuxearMFs9wchcWPs+goGiRyy pXrNqzwxJunxgpVdEO/7f/bxKqd4nuZZiDqSIlFIJQ== X-Received: by 2002:a05:660c:f94:: with SMTP id x20mr2394129itl.144.1545136458608; Tue, 18 Dec 2018 04:34:18 -0800 (PST) MIME-Version: 1.0 References: <20181128232019.GC131170@gmail.com> <20181217181244.220052-1-ebiggers@kernel.org> In-Reply-To: From: Dmitry Vyukov Date: Tue, 18 Dec 2018 13:34:07 +0100 Message-ID: Subject: Re: [PATCH RESEND] KEYS: fix parsing invalid pkey info string To: Linus Torvalds Cc: Eric Biggers , James Morris James Morris , Mimi Zohar , Jarkko Sakkinen , Peter Huewe , David Howells , keyrings@vger.kernel.org, Linux List Kernel Mailing , syzkaller-bugs 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 7:43 PM Linus Torvalds wrote: > > On Mon, Dec 17, 2018 at 10:13 AM Eric Biggers wrote: > > > > Hi Linus, please consider applying this patch. It's been ignored by the > > keyrings maintainer for a month and a half with multiple reminders. It > > fixes an easily reachable stack corruption in the new keyctl operations > > that were added in v4.20. It was immediately reached by syzbot even > > without any definitions for the new keyctls yet. > > The getoptions() code in security/keys/trusted.c has exactly the same > buggy pattern, and seems to actually be the source of that idiocy. > > Mind fixing that one too and getting rid of this incorrect code entirely? > > Also, maybe the right fix is to do the "check for duplicate tokens" > only *after* all the other validation (ie after the switch())? > > Or maybe just remove it entirely, since it's clearly entirely > incorrect from the very start. > > Finally, the code was actually originally introduced in commit > 5208cc83423d ("keys, trusted: fix: *do not* allow duplicate key > options"), this second place you found is just pattern matching from > that original garbage, that was acked and "reviewed" by several > people. ... also acked by 0 tests added by that commit. > The fix should have that clarification. Commit 00d60fd3b932 > wasn't the _origin_ of this bug, even if it made a copy of it. > > Looking around, nobody else has picked up that incorrect pattern. > > Linus > > -- > You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group. > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/CAHk-%3Dwhmh8WdcKHdYjioJNjyeewv%3DfO1H0hxXqDh6kiX0YvzmQ%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout.