From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1p83PN-0008WA-84 for mharc-grub-devel@gnu.org; Wed, 21 Dec 2022 13:01:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p83PL-0008W0-Nz for grub-devel@gnu.org; Wed, 21 Dec 2022 13:01:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p83PJ-000477-Rl for grub-devel@gnu.org; Wed, 21 Dec 2022 13:01:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671645692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=x9To3Dfqd8+jk873YB3jQBUvZKyXOLFplNH+E1YSH2o=; b=PBgNc+jaY7cldJi6cdnNzmXkVJi1UWoxbrjBtGRMnU8NCWnB+55P0FprP0JyGCMsO3OS+I p4xttll+zX34CIf78fb9SALqk6eMoxoEMyK965ULYvVriK3UQomoeKXueg2Aj7X+cE2cSr 49B58RVZuSctPwdA52tacrbSP3GadEc= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-240-tI3LucCFOySWQJii6E5JmA-1; Wed, 21 Dec 2022 13:01:30 -0500 X-MC-Unique: tI3LucCFOySWQJii6E5JmA-1 Received: by mail-qk1-f197.google.com with SMTP id w14-20020a05620a424e00b006fc46116f7dso11827849qko.12 for ; Wed, 21 Dec 2022 10:01:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=x9To3Dfqd8+jk873YB3jQBUvZKyXOLFplNH+E1YSH2o=; b=YU8pAn5szOPuyUEZHrxVmfk6/3NbxHEomkHk6hEfiZGlq8ndx13xYI37gzFdacq/vw 4jOqg9hsOtHAk8OrU25sP1kFMcUwfQC7RdVFZWfxmA5tiwDfEL1ZzW+xFjIhlKzJJyGr MFIRv0iguNt4pt4h6nHMm45ndjipUQuZO/9rG2VEGlGRqipw3UhIXdtt1fMil4mWwPJO mcdCYltwFgAlkYmG04ifdDdp1EGFlXVF8yBxeUVFJF7V3V5JQixvTkk/OJfOxjx8bISt hTEyjpm088IbEQ68nYz7WgDM31uPk1MbJG8tzPjnjjD/JeUT1orbsEgnRXBR04dY+Ebp LtYw== X-Gm-Message-State: AFqh2kqg0tEIJBAMe59G5r0nQ9WzpGs+euXH10vwbG3lx1hkaONbHb3J JLcu8GLbHe/2z6rlMeneHjq90ybCI9/2igUycOwi/fXh/dbMsl9yTiPcBIsHmo1nROI19vsnWdm UKfSWHL6d6og= X-Received: by 2002:a05:622a:4d47:b0:3aa:82c0:1ca3 with SMTP id fe7-20020a05622a4d4700b003aa82c01ca3mr3531395qtb.23.1671645690044; Wed, 21 Dec 2022 10:01:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXtcll27kHtl1VGA322Dw2PEg0Aq5PQjeVB5vTHb4ar66OGYWlmvbirxwzSxCZwIqIA5fG5gdw== X-Received: by 2002:a05:622a:4d47:b0:3aa:82c0:1ca3 with SMTP id fe7-20020a05622a4d4700b003aa82c01ca3mr3531341qtb.23.1671645689458; Wed, 21 Dec 2022 10:01:29 -0800 (PST) Received: from localhost ([2600:4040:520a:8800:7d1c:f0a7:5c44:ed0e]) by smtp.gmail.com with ESMTPSA id dm36-20020a05620a1d6400b006bbc3724affsm11065137qkb.45.2022.12.21.10.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 10:01:28 -0800 (PST) From: Robbie Harwood To: Zhang Boyang Cc: The development of GNU GRUB , Glenn Washburn , Daniel Kiper , Pete Batard Subject: Re: [RFC PATCH] kern/dl: Add module version check In-Reply-To: <3326fa35-0c2a-2a71-c191-a1195b52f550@gmail.com> References: <20221219153329.154238-1-zhangboyang.id@gmail.com> <3326fa35-0c2a-2a71-c191-a1195b52f550@gmail.com> Date: Wed, 21 Dec 2022 13:01:25 -0500 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=170.10.133.124; envelope-from=rharwood@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2022 18:01:36 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Zhang Boyang writes: > On 2022/12/21 06:58, Robbie Harwood wrote: >> Zhang Boyang writes: >>=20 >>> This patch add version information to GRUB modules. Specifically, >>> PACKAGE_VERSION is embedded as null-terminated string in .modver >>> section. This string is checked at module loading time. That module will >>> be rejected if mismatch is found. This will prevent loading modules from >>> different versions of GRUB. >>> >>> It should be pointed out that the version string is only consisted of >>> PACKAGE_VERSION. Any difference not reflected in PACKAGE_VERSION is not >>> noticed by version check (e.g. configure options). >>=20 >> Right now, this only affects non-secureboot scenarios (because we don't >> have external signed module support). I would want to see a resolution >> to the external module signing question first so that we don't paint >> ourselves into a corner with something like this. > > This feature is a prerequisite for external signed module support (and=20 > it is mainly designed for this purpose). SBAT itself is not sufficient=20 > to protect version mismatch attacks. To be clear, I was not intending it as such. That said, I dislike some of your terminology: version mismatch is not generally an attack, merely a self-own. If you can write to and subsequently execute bootloader files, you already have root to the box - there's no attack. Secureboot works by limiting what can be executed, and you simply can't have that on Legacy BIOS. So I think the order you're designing here is backward. >> The combination of those two things leads me to suspect this is not the >> right approach. It seems likely that if we want to down the road of >> versionlocking, something like the kernel's ephemeral key approach would >> be better suited - and if we want external modules (which I don't think >> we do), full SBAT support. > > Sorry but I'm not familiar with the kernel's ephemeral key approach.=20 > Could you please give me some links to this? https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/mod= ule-signing.rst Be well, =2D-Robbie --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEA5qc6hnelQjDaHWqJTL5F2qVpEIFAmOjSfUUHHJoYXJ3b29k QHJlZGhhdC5jb20ACgkQJTL5F2qVpEI/GA//b+6AVY78jk4OWrIRUxT2lWl5cYdL s7rHVDnhwpQCmllvJL72w0vv1CFkdRgKdQRaGfk2R7Erif6peOOJNWLFGnppmkiS LjfnCNciKwS76GOL4atbgRKlv8wPs6jeAde1JydV9WyCo8iQ69VsKVftGxuOq5u0 0rKD6LZ+17mqq9wRccnnd9snMq9UdnrMifYKcIUp52EjNEhGPy2FMxXB4c/txpn9 0ihVrSm0zAAbfRSfSp3hRSMLG86cenG8jY94Q4629mNoVuGA5WrZCHPq7xDybq6z cmlrrS6ABF5NG1G7sBHw60LrEFJrub53rw5Zvsv9frSSNc0Xxg0gjnVRf4+80uIK 4ZNQrUqNSQvbaMwGwjWs6uBeHFpCpLEK2lQKj/iVr344XfbdYTOzB6m8Q06z2w0c 4Aa2p3S2AcnYttCCeNnr0L3tLqKv0YsSc8xUiD70AU+ge3slFxWnlTAWHwWdn02t dA/hWksrcqou8Db7j0Dj41hodMHcKx18QbC21nMY9v3OWaCSB8Km68EnP3h+2AMA ON9TfOVJ6mWWA85HTvbmF7zbONjicGk1DltoVviBWncjSf4auaIDHcITyriOMBj3 L6y0dfRygtJYh2SNIdqzWJGIAk2QwiNJ9lLzfc5V6F2VT/ZD7w+X7c7e88G4pZAA /BJyd9Gvk9NqrD4= =UCDF -----END PGP SIGNATURE----- --=-=-=--