Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1273768pxu; Mon, 23 Nov 2020 16:43:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLt0ttescUPr3zp3RUg8riZ+EnGlZKHQUisFk0VWpXxMRfbkwTrk6JZOn4EbKi8fz+b4lt X-Received: by 2002:a17:906:aad7:: with SMTP id kt23mr2084748ejb.158.1606178597034; Mon, 23 Nov 2020 16:43:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606178597; cv=none; d=google.com; s=arc-20160816; b=aW6dAX/sCxpxyrP1bjVHT03IR6056AbvnROsQ2j273Bn5W6Ornqw2WsJC8Uw3ZdKv6 ree2lFdLHS5hzmXnQONNwjeXwDX6EgtH2cDhs7ad/LbLu1i59vYHSIzUZAOHUoGl5sN3 KCZZvNFUYrhrpWVBUUszE6zIkD/S6LZW1ii0XYcwxcUdwC15oXITt6/lgs+KPSA4MU9V PZ72zGRwnGUmLFNCrmGgyO4xm8ZR/l5YdA/dLLogEqEjqlcbmYPssiZ7huwK7a+ShYRf PuGgnFatvSeznpUdBc2sorzwXT2vrJjOgnxZ2pb51qn3oqifhOCWEcYT0HQiZuDw86fB htKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZB3RzTtOX5Vi4wJPeUnMotilF2kP22sMOQsBxc6+YQs=; b=Xz27Q4OALyuBTlSBVkXgL2CNS5Eidka8ZwqK9TuDpdctunRwl+aFmwVGzHjBAol0nd z2AA/fV/hFkpL1Kq6J26m5NDzkVKFB4oeIJeck0BTUBEyB9ylUvyRa/0I2fxWHyY7nST Lx2UzEB5qeg5i5NnWrg4R9Bn7mYwDI/0/ivoqiPOSEFPWt+NNUftwnbI0l9m2Bj3zah5 TmwYED2YgIxxBYbiZe+tTGEOOroVKU3zBMXLtVLVm3yte2AP8DgU5nhEBbsJxj50m/Mq Tu4B/DZyFbA2F4LdvbLVxxt5UwhAGHefEp1NJkLum8YSStD1udjYhY/a2puOKXqlbZEG +30g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="rX3Q/KMP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id i23si7292198eja.270.2020.11.23.16.42.53; Mon, 23 Nov 2020 16:43:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="rX3Q/KMP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727415AbgKWXyh (ORCPT + 99 others); Mon, 23 Nov 2020 18:54:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727408AbgKWXyg (ORCPT ); Mon, 23 Nov 2020 18:54:36 -0500 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34B2DC061A4D for ; Mon, 23 Nov 2020 15:54:35 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id 23so20499128wrc.8 for ; Mon, 23 Nov 2020 15:54:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZB3RzTtOX5Vi4wJPeUnMotilF2kP22sMOQsBxc6+YQs=; b=rX3Q/KMPxyAVPoYlG/3ex3KT+pJZzoCmRUPGxMABV+0J6MCzg40pmf24cvQC73ClD/ egCSQKk2ZVgLtnEoLw8RjKCX6TrsLh4F+L+FSHwbv9LhIn8UyzGSiuf+3RVQBsCFeTqs 6vYNqHgCxUvvNBZUo7a91GgGX3utvoFurF3zW+nobJzb+2JHT7dEMXZVAMadQu4871FL tqzOVWPDQDlF4+q3eyEYCzYRhXgDVwY5juYAe5F7Br85R9rvKMXolbs8hcr6y3zXVILR ijGnVWOGhA4ugHKpQU5m/piWwr2UWn70UpOHaHaRxIMlX2ra3vihp3t4wiAa/qdh4ULY pmgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZB3RzTtOX5Vi4wJPeUnMotilF2kP22sMOQsBxc6+YQs=; b=CN4e1VBKErMpb8Dr9RMvudBuNF2RVZ8xPkfDqo37b4bNvKXZD5dV+Vyd6uzURBmKU5 nsj+3EospTb/cM1t/V0AtDaH89RhzF0XrPbAgflHMwlBI8BsEXxPqvIFwVoZ/KkhNpoj X5r2imGzo/nqiJDpzfxsqcQyAHZhSIx7etsArnANWvkK0m3L9BQzihwDB0+Qbg7yja1l 9jBafoP4uvgS78x0sAJKh17JEbfASPVqXZnmQREOy67LF7/QR3Yv3V7NUZoZDsfHOn3r 06JF1bO9FMRcirEzIXTT8UFFQaKp0oKkmIQIGmB5NExgAv+anblpiKZLuaskptQ3QItn foLQ== X-Gm-Message-State: AOAM5324vGBjMnwOIwDRx0H6yAr/btL10i6IdcUDKbSTCOGirN2qsS1P QveBnqsYP8XADTWgvg+aXXbc5HiolSTB194u X-Received: by 2002:adf:f5c8:: with SMTP id k8mr2230194wrp.2.1606175673552; Mon, 23 Nov 2020 15:54:33 -0800 (PST) Received: from localhost ([2a02:168:96c5:1:55ed:514f:6ad7:5bcc]) by smtp.gmail.com with ESMTPSA id z6sm1704751wmi.1.2020.11.23.15.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 15:54:32 -0800 (PST) From: Jann Horn To: David Howells , Jarkko Sakkinen Cc: keyrings@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] keys: Remove outdated __user annotations Date: Tue, 24 Nov 2020 00:54:00 +0100 Message-Id: <20201123235400.1609970-1-jannh@google.com> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the semantics of the ->read() handlers were changed such that "buffer" is a kernel pointer, some __user annotations survived. Since they're wrong now, get rid of them. Fixes: d3ec10aa9581 ("KEYS: Don't write out to userspace while holding key = semaphore") Signed-off-by: Jann Horn --- security/keys/keyring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 14abfe765b7e..977066208387 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c @@ -452,7 +452,7 @@ static void keyring_describe(const struct key *keyring,= struct seq_file *m) struct keyring_read_iterator_context { size_t buflen; size_t count; - key_serial_t __user *buffer; + key_serial_t *buffer; }; =20 static int keyring_read_iterator(const void *object, void *data) @@ -479,7 +479,7 @@ static int keyring_read_iterator(const void *object, vo= id *data) * times. */ static long keyring_read(const struct key *keyring, - char __user *buffer, size_t buflen) + char *buffer, size_t buflen) { struct keyring_read_iterator_context ctx; long ret; @@ -491,7 +491,7 @@ static long keyring_read(const struct key *keyring, =20 /* Copy as many key IDs as fit into the buffer */ if (buffer && buflen) { - ctx.buffer =3D (key_serial_t __user *)buffer; + ctx.buffer =3D (key_serial_t *)buffer; ctx.buflen =3D buflen; ctx.count =3D 0; ret =3D assoc_array_iterate(&keyring->keys, base-commit: d5beb3140f91b1c8a3d41b14d729aefa4dcc58bc --=20 2.29.2.454.gaff20da3a2-goog