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: 10836099 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 4B0621390 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 39C062FE4F for ; Fri, 1 Mar 2019 20:10:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DB102FE59; 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 D07C62FE4F for ; Fri, 1 Mar 2019 20:10:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726195AbfCAUK1 (ORCPT ); Fri, 1 Mar 2019 15:10:27 -0500 Received: from mail-yw1-f74.google.com ([209.85.161.74]:53098 "EHLO mail-yw1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726254AbfCAUK1 (ORCPT ); Fri, 1 Mar 2019 15:10:27 -0500 Received: by mail-yw1-f74.google.com with SMTP id t9so23541051ywe.19 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=bLWyvcZSwXVmwsUP9B91Vg6W+uK1ixlbzPwCA/UgQ8EEL3BsQcUl9TmzZ0Yy+3IlF/ GSoQWi0f0HNNPnxNAjkLjNgU0f+IDFj0s5CGiYhJd1EVHG1wggjSmhgfFHBGIO95b3zK jF6pjaNl653Q5CHvLGjNDfd75XajJMrXD5/Yu4fwnuPJ3dZBVc/42kQdoIOdt5Yo9WEE 574fw2La7j1TIiwR4NRxG/yx7kpkqGhH7jVGGbzyrU0i8uS2C2Tby86Qq2ZANvM/JXxi nwSIDfdyztpvIht+/xDL1t5rSi62Gj1lJdxgdjTxdwNE0tXRRLk4vSy4woKP6ffqCV4i Aqvw== X-Gm-Message-State: APjAAAU8ubkmPVDGWybS9gOnT1cJcoXT5wNlChtpFs3/q1FGxs0ReroU lyQTCIcRd2SzTPzigyPtmuo14IWpOw== 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-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@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);