From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B35CBC433E2 for ; Wed, 8 Jul 2020 16:12:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92D1C2078D for ; Wed, 8 Jul 2020 16:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594224769; bh=wvHjxZxUZUUkYWq6mEbxkcnvzWEL0F6xg2+xf/F0qnA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=QyXitm8aqzQvqeQkw/wWkM8w0ZpCGGcrkQuNaLIfhVF0TfSUq2JnO2Xz0QTqMZFhd G2dl+cJWOZdvfDhMATeD+EGXGsbrql7SsHKAZ+Z2jw6GNkWeaY6Twem6RNtUmu4nb/ Cx5FYBQ/6I+0pyoREVSllA16VBJHBm2Juhr4NaSQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730481AbgGHQMn (ORCPT ); Wed, 8 Jul 2020 12:12:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:43194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728148AbgGHQMm (ORCPT ); Wed, 8 Jul 2020 12:12:42 -0400 Received: from linux-8ccs.fritz.box (p57a23121.dip0.t-ipconnect.de [87.162.49.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F3F4620720; Wed, 8 Jul 2020 16:12:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594224761; bh=wvHjxZxUZUUkYWq6mEbxkcnvzWEL0F6xg2+xf/F0qnA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OdlewKOXT4w7chOuimi+NRrqQKuLn+dX5NTKYo4SIzQyDzA12aSFG6KscIhvd9VHU cebUXOVOlotPVrB9iqWRvv5KxuVMB+L50oQ1FRo3NwitSn01OTkTU6LrbmN74gjyPi LJfjrwd4dzS6QqKI3qGEuCERfNXDGHfirUjbEXZA= Date: Wed, 8 Jul 2020 18:12:33 +0200 From: Jessica Yu To: Kees Cook Cc: Dominik Czarnota , stable@vger.kernel.org, Linus Torvalds , Greg Kroah-Hartman , Andrew Morton , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , KP Singh , "Naveen N. Rao" , Anil S Keshavamurthy , "David S. Miller" , Masami Hiramatsu , Jakub Kicinski , "Steven Rostedt (VMware)" , Dmitry Safonov <0x7f454c46@gmail.com>, Will Deacon , Alexey Dobriyan , Marc Zyngier , Masahiro Yamada , Al Viro , Matteo Croce , Edward Cree , Nicolas Dichtel , Alexander Lobakin , Thomas Richter , Ingo Molnar , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/5] module: Do not expose section addresses to non-CAP_SYSLOG Message-ID: <20200708161233.GB5609@linux-8ccs.fritz.box> References: <20200702232638.2946421-1-keescook@chromium.org> <20200702232638.2946421-4-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200702232638.2946421-4-keescook@chromium.org> X-OS: Linux linux-8ccs 4.12.14-lp150.12.61-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org +++ Kees Cook [02/07/20 16:26 -0700]: >The printing of section addresses in /sys/module/*/sections/* was not >using the correct credentials to evaluate visibility. > >Before: > > # cat /sys/module/*/sections/.*text > 0xffffffffc0458000 > ... > # capsh --drop=CAP_SYSLOG -- -c "cat /sys/module/*/sections/.*text" > 0xffffffffc0458000 > ... > >After: > > # cat /sys/module/*/sections/*.text > 0xffffffffc0458000 > ... > # capsh --drop=CAP_SYSLOG -- -c "cat /sys/module/*/sections/.*text" > 0x0000000000000000 > ... > >Additionally replaces the existing (safe) /proc/modules check with >file->f_cred for consistency. > >Cc: stable@vger.kernel.org >Reported-by: Dominik Czarnota >Fixes: be71eda5383f ("module: Fix display of wrong module .text address") >Signed-off-by: Kees Cook Tested-by: Jessica Yu Acked-by: Jessica Yu