From patchwork Fri Mar 1 20:10:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jann Horn X-Patchwork-Id: 10836101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 65B5F180E for ; Fri, 1 Mar 2019 20:10:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 589822FE4F for ; Fri, 1 Mar 2019 20:10:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C7AC2FE51; Fri, 1 Mar 2019 20:10:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F269B2FE51 for ; Fri, 1 Mar 2019 20:10:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbfCAUK1 (ORCPT ); Fri, 1 Mar 2019 15:10:27 -0500 Received: from mail-yw1-f74.google.com ([209.85.161.74]:39874 "EHLO mail-yw1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbfCAUK1 (ORCPT ); Fri, 1 Mar 2019 15:10:27 -0500 Received: by mail-yw1-f74.google.com with SMTP id f82so15440135ywb.6 for ; Fri, 01 Mar 2019 12:10:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=0pj3h/XnwOwIzHOuDRkJHpH5NVy6ymoFJNdB153FB1s=; b=Hwdmx+4KRQbz6Vx9b18wMgbTr+6Cv9XfreEUSnAPHoibjc4Hnh6tLvaoANhM8bDqWN jbMlWGs03KcgaxSiHVgqv24w/+Dq/8oe8KiMef0+BixH2fxmvcGdIKlShwDWGN3CHA1+ azm09dqG094Lq2nIxZOr7hvzUd1Q3c9lTMGPxe+70qV1hbMppjzySpXPE+DYuDUxXq9D nZ5MHlH0aVg/bEH/feg0AqTALVROrdBeEjrkE4zWkeTrG8z2SP8CW+mFP5RZuMehvXhk ZZNuLtmzwSJ4WH5NwNPrMjTpryHLte32gcKOoVwYWaAqvyc1VWKjN0w+qlzOLtKf3sFr 2Zjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=0pj3h/XnwOwIzHOuDRkJHpH5NVy6ymoFJNdB153FB1s=; b=acWuKsivki0jHu4sQ7KJEOTgmmuSqqumMIpV8cs8Auo/VJoto9cASq3oc/EthDj+1T pDTAOEr98T9SG/qC2RU0+Aua6M17tUuAgY4bkotgWCBg0Cd8lF137KTHZgudUnIJ0wWJ NEqp7lxJvTr8K1wTvP3hQ4y2H31kjoK0zD0sKe6xPLoF8sNsvvZ9Wnszcs16eN586XRq lRBdTJZqVaUDo0Jd55nGCqJWjl/iGBcIwZeT2x5maeo7wXO8hc+gbXYX+QqnpJgyf2T8 2FZg9omRU+4cwYR7B/nTqUD70DMO72vX2Hxfyu34dSyHEob+7Mi/ebRAkd7/Bt1JfKmP lkDQ== X-Gm-Message-State: APjAAAXJpsD2Bsgao2yuILQgJNAygvMjIhqsH+zRD08B+MqbQlWwVkJx wroExwSl1xhxk50WAx9GPo3jh6E/cQ== X-Google-Smtp-Source: APXvYqxp26fpoSLFLbW+Jmjloi/7TCoqGyJfoK6CR0vXEYcLAvImbDwo5re+YvSQApTWCo6VnOWRtEYVyw== X-Received: by 2002:a25:bed2:: with SMTP id k18mr3198613ybm.72.1551471026380; Fri, 01 Mar 2019 12:10:26 -0800 (PST) Date: Fri, 1 Mar 2019 21:10:10 +0100 Message-Id: <20190301201010.19094-1-jannh@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.21.0.352.gf09ad66450-goog Subject: [PATCH] integrity: use KERNEL_DS instead of get_ds() From: Jann Horn To: Mimi Zohar , Dmitry Kasatkin , jannh@google.com Cc: linux-integrity@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP get_ds() is a legacy name for KERNEL_DS; all architectures #define it to KERNEL_DS, and almost every user of set_fs() uses the name KERNEL_DS. Let the integrity subsystem also use KERNEL_DS so that we can get rid of get_ds() at some point. Signed-off-by: Jann Horn --- security/integrity/iint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/integrity/iint.c b/security/integrity/iint.c index 88f04b3380d4..423876fca8b4 100644 --- a/security/integrity/iint.c +++ b/security/integrity/iint.c @@ -200,7 +200,7 @@ int integrity_kernel_read(struct file *file, loff_t offset, return -EBADF; old_fs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); ret = __vfs_read(file, buf, count, &offset); set_fs(old_fs);