Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1863165ybp; Wed, 9 Oct 2019 21:57:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqw058/6CdcVfs3alHqY7mCaAJT2diCpM2FVsmWVy1/jU6DfOWjU1JrL6LzeMXj+LvDgTAqS X-Received: by 2002:a17:906:2ada:: with SMTP id m26mr6243964eje.87.1570683436506; Wed, 09 Oct 2019 21:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570683436; cv=none; d=google.com; s=arc-20160816; b=gpwtkmIkZdvQC6p4ILeweYGevqRG2tsRn21oEbHCqO7OC3+x/BOlZtX46cRBOo3EID 5UkurNO792pgMRH0kV88FFo5/0W+xx14JhlXDRdhvIRWAERfUDVFRVLEbXrkmA7sSx1j 1TNYB47jFXcT+nTC3mIXYBjF5GtUBKoG1QThAUw3dQPc9CxTd18qZSZ+qyao/EPPAEA5 BmxTChE8Q278+ZpEG7f8Mu1nsPLKY/nYCN+bKQOEx3yNM9RtTc53pEudhCECnKDQdtqy pvN8frV29yPRerVdtS1memlhZAeuli6Otbk0YXBttxpGaHc2Mdm0Ckkynok+ABMuytLF xRLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :mime-version:ironport-phdr:ironport-sdr:dkim-signature; bh=qNxdxggCQd3xr6rdB50E8SDcymvAFEfwkLrZ0yN0AVk=; b=D6dyJgoc9CjPIRL+q+BFKFSxDpM/Z9IXTvTtsWy8qw0bItelGRkHDdXD6bmt+gmO5T Z/Rn4fKX/qmkC+zfdYq8jfwC9TlhtPuViqUGqaWeLTEFHZtCAXmaM1jADZhHlTaWuH+D XGwMyd8eLfa5wvjscCZvTuTuMkdj6r0gNUMOheGsbnF5ReS+4AVe2rgknrc7b0fDbGbD 3PT4JscbP1UhPgI/nuE4y4THkvft5Nn63Jz1PJBvelDnC7A8PLpHPC7b23Zl6Tp/wqog baIeHXjB0oqcSLhNz0cveRoh9P/0jb59B3e2ivTNWOgfHOKavsgcU9+3SaVCPN3fPG4Y SbvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ucr.edu header.s=selector3 header.b=tkjd0RcG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ucr.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13si2575077edy.320.2019.10.09.21.56.52; Wed, 09 Oct 2019 21:57:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ucr.edu header.s=selector3 header.b=tkjd0RcG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ucr.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726659AbfJJE4f (ORCPT + 99 others); Thu, 10 Oct 2019 00:56:35 -0400 Received: from mx1.ucr.edu ([138.23.248.2]:27053 "EHLO mx1.ucr.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbfJJE4e (ORCPT ); Thu, 10 Oct 2019 00:56:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ucr.edu; i=@ucr.edu; q=dns/txt; s=selector3; t=1570683395; x=1602219395; h=mime-version:from:date:message-id:subject:to; bh=l8fka7UYOSDuLxUdqgi3tx7DvHNj0L8HgAjIPCh+cSg=; b=tkjd0RcGZuHPYaNLbkDNXv5uyop0AZvc4JQX6NUuM/5JUR0p12IjM90I HFrCxXKuDCEcpZU8j8YYv3yt1I7s1IIez/e7W8Mv/IY5mbf6nZh06US3c MO5pfFlNCCgHaxiOlbW2Q/tLmGJCQXt8tQ1VkAYdltEhlJpVr9rNwsbvI Bfeqjf1s34ZSp5mwaRkieUJKJpaoL6RA+vfcY9+hqMrpsmApIfhNVonst TSYoGXyYXkOCNwDnLknVF9shs7f4765Crtr3SCMUETEvdWEi9Iwp73RFl q8dlMYzc1tXuZiD6nE56+aFMF3BIhaZH5iIW+BVOKWNq0Ap00V46yi+ey A==; IronPort-SDR: s/qN1uASMRCZWp4JYwc6ThIpqYnJGheojd4O33+jOPR7RfmpoukxfSBrIQOqTLEsQ2upLIOoND 7qsvUniZDOGp1+GgaGM1RG27a0MhpYHdCeysze96F37+JRUWfBJKt8bvxSTagvW6XsExV7qyCV HegLhvPne8QGtyXk9YTsurN79ebqkGW9YrE/3uIHGzigsc79z8VerswHUFRgTOJWK+/L1UT4ko FfPmdYQeqTZpE5LRecmlb50wGfm9SQZuupzlLd0cKw0U3VMkuJgA+nxDuym0H8HonHP2n9g+Pf 4bs= IronPort-PHdr: =?us-ascii?q?9a23=3AEnSidBMe21SPoefMuFwl6mtUPXoX/o7sNwtQ0K?= =?us-ascii?q?IMzox0I/X7rarrMEGX3/hxlliBBdydt6sfzbSM+PG4EUU7or+5+EgYd5JNUx?= =?us-ascii?q?JXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQ?= =?us-ascii?q?viPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCezbL9oLRi6swrdu80KjYB/Nqs/1x?= =?us-ascii?q?zFr2dSde9L321oP1WTnxj95se04pFu9jlbtuwi+cBdT6j0Zrw0QrNEAjsoNW?= =?us-ascii?q?A1/9DrugLYTQST/HscU34ZnQRODgPY8Rz1RJbxsi/9tupgxCmXOND9QL4oVT?= =?us-ascii?q?i+6apgVQTlgzkbOTEn7G7Xi9RwjKNFrxKnuxx/2JPfbIWMOPZjYq/RYdYWSG?= =?us-ascii?q?xcV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kPEUZE?= =?us-ascii?q?MoKtSwjg3ElxiqCr5dw62ZBJU1qvqH92X6PYBwx2uQh/pptEUvXsYabT7uva?= =?us-ascii?q?V47QWGQteRy0g=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2FXAwBKuZ5dgEanVdFlDoZEhE2OW4U?= =?us-ascii?q?XAY1pijQBCAEBAQ4vAQGHGCM4EwIDCQEBBQEBAQEBBQQBAQIQAQEJDQkIJ4V?= =?us-ascii?q?CgjopAYNVEXwDDAImAiQSAQUBIgEaGoV4pEGBAzyLJoEyiGQBCQ2BSBJ6KIw?= =?us-ascii?q?OgheBEYsigl4EgTkBAQGVL5ZXAQYCghAUjFSIRRuCKgGXFY4tmU8PI4FGgXs?= =?us-ascii?q?zGiV/BmeBT08QFI9aWySRSwEB?= X-IPAS-Result: =?us-ascii?q?A2FXAwBKuZ5dgEanVdFlDoZEhE2OW4UXAY1pijQBCAEBA?= =?us-ascii?q?Q4vAQGHGCM4EwIDCQEBBQEBAQEBBQQBAQIQAQEJDQkIJ4VCgjopAYNVEXwDD?= =?us-ascii?q?AImAiQSAQUBIgEaGoV4pEGBAzyLJoEyiGQBCQ2BSBJ6KIwOgheBEYsigl4Eg?= =?us-ascii?q?TkBAQGVL5ZXAQYCghAUjFSIRRuCKgGXFY4tmU8PI4FGgXszGiV/BmeBT08QF?= =?us-ascii?q?I9aWySRSwEB?= X-IronPort-AV: E=Sophos;i="5.67,278,1566889200"; d="scan'208";a="13444717" Received: from mail-lf1-f70.google.com ([209.85.167.70]) by smtp1.ucr.edu with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 09 Oct 2019 21:56:32 -0700 Received: by mail-lf1-f70.google.com with SMTP id c7so1051234lfh.9 for ; Wed, 09 Oct 2019 21:56:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qNxdxggCQd3xr6rdB50E8SDcymvAFEfwkLrZ0yN0AVk=; b=j+14EuMEOM/anjvZvs8FdiYl3EyEEnK4opNgiqzpByqOzRqKd8uKZKRVveWTyCPTD7 zwoMlGEJNvNelBzSQHMyU2eO80s1FnO+X9GQsym6zaaSV+pqx+CHDXHVIuajLRTzauTg kN0oQTudvkJxPnKKfDqrUr7pP+GDeCoSysuAs0C7Uku7LxAQToT1+YJtcH5yZvohgrBN JudUgqXj09nWLumLLfbC9yWQfKtrY6z6wW1W3ktTrHZrf5exBt0RzNi3sPSHEyKpEQJL cPNcsUFTtNJKt9TS6cPd0JvmqtBhnfL9dSXrX//448TCp35LEUxfQedgK5X24QiRM1Ix 2Nmg== X-Gm-Message-State: APjAAAWGMKWjAj9679VpSBA3mrrJvoIPqbQvvSxCPV0Si4jituYGtHqn hxpqZkJzZu8Mo43TuRJLnEC74WncJnF/m/Fqv0bxlNyuSf0n5yRBhAa4ay0+fy9XaEPLdsa/cA2 u3OVqdhEHsiDjyWpxnzvvzB6D5Uybsz3o7VnjHjZGvQ== X-Received: by 2002:a2e:8315:: with SMTP id a21mr4754242ljh.133.1570683389974; Wed, 09 Oct 2019 21:56:29 -0700 (PDT) X-Received: by 2002:a2e:8315:: with SMTP id a21mr4754231ljh.133.1570683389789; Wed, 09 Oct 2019 21:56:29 -0700 (PDT) MIME-Version: 1.0 From: Yizhuo Zhai Date: Wed, 9 Oct 2019 21:56:04 -0700 Message-ID: Subject: Potential NULL pointer deference in mm/memcontrol.c To: Johannes Weiner , Michal Hocko , Vladimir Davydov , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zhiyun Qian , Chengyu Song Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All: mm/memcontrol.c: The function mem_cgroup_from_css() could return NULL, but some callers in this file checks the return value but directly dereference it, which seems potentially unsafe. Such callers include mem_cgroup_hierarchy_read(), mem_cgroup_hierarchy_write(), mem_cgroup_read_u64(), mem_cgroup_reset(), etc. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside