From patchwork Tue May 12 18:17:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 11543727 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E322E92A for ; Tue, 12 May 2020 18:17:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D43F62080D for ; Tue, 12 May 2020 18:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730935AbgELSRX (ORCPT ); Tue, 12 May 2020 14:17:23 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:26516 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730934AbgELSRW (ORCPT ); Tue, 12 May 2020 14:17:22 -0400 IronPort-SDR: XLHJZvM85Y/wWWMS7jaUJTRfDk22UeI837iQWRFiJcqOKMtbLpNxeYLeWrBcfgDNaiu1oQ9zt9 24URL+D94do0dp09BFLY4GStmlcolJeIHjAeGD1hmax34ywUH5J4X5MFYo25vpBBVmdYcMiyxH DqA8HW85HIFMaVmbo+FNj7C334Dtf0s/uZadXVYpczgxm3V6mnPCGVBWHtNOYqiYgUMfLQNLCf xNuV5+JU0hxmRg1XLQRPzC4oYUBHjLyNONfkl5gsg0C6cNpLyJ/Kbo0u66pPtm7+tPp3Owj32I 4UE= X-Belgacom-Dynamic: yes IronPort-PHdr: 9a23:YD34xhc0ze1hIeaccVIMT+EBlGMj4u6mDksu8pMizoh2WeGdxcW+bB7h7PlgxGXEQZ/co6odzbaP7uaxAydZuMbJmUtBWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFRrlKAV6OPn+FJLMgMSrzeCy/IDY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1AWAYzM9by1eF2BsrzUQGJKtmAQliOWda3BzwtCNg8lYxdK31hEsmv20iQlxGhBKUYwuSG X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BnFQAE57pe/xCltltmglKBey2BZBIsjSWFfIwYj16BegsBAQEBAQEBAQE0AQIEAQGERIIEJzoEDQIDAQEBAwIFAQEGAQEBAQEBBAQBbAQBAQcKAgGETiEBAwEBBQoBCwgwgjsig0ILASMjT3ASgltLglgpsT0zhVGDV4FAgTiHXYUBgUE/hF+KQgSYEJpbglSCcZUrDB2dOi2PcJ8+BhmBVk0gGDuCaVAYDYlElUZCMDcCBggBAQMJVwEiAY4IAQE X-IPAS-Result: A2BnFQAE57pe/xCltltmglKBey2BZBIsjSWFfIwYj16BegsBAQEBAQEBAQE0AQIEAQGERIIEJzoEDQIDAQEBAwIFAQEGAQEBAQEBBAQBbAQBAQcKAgGETiEBAwEBBQoBCwgwgjsig0ILASMjT3ASgltLglgpsT0zhVGDV4FAgTiHXYUBgUE/hF+KQgSYEJpbglSCcZUrDB2dOi2PcJ8+BhmBVk0gGDuCaVAYDYlElUZCMDcCBggBAQMJVwEiAY4IAQE Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO biggussolus.home) ([91.182.165.16]) by relay.skynet.be with ESMTP; 12 May 2020 20:17:20 +0200 From: Fabian Frederick To: jack@suse.cz, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, Fabian Frederick Subject: [PATCH V2 1/6 linux-next] fanotify: prefix should_merge() Date: Tue, 12 May 2020 20:17:15 +0200 Message-Id: <20200512181715.405728-1-fabf@skynet.be> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org prefix function with fanotify_ like others Signed-off-by: Fabian Frederick --- fs/notify/fanotify/fanotify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index 5435a40f82be..95480d3dcff7 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -70,7 +70,7 @@ static bool fanotify_name_event_equal(struct fanotify_name_event *fne1, return !memcmp(fne1->name, fne2->name, fne1->name_len); } -static bool should_merge(struct fsnotify_event *old_fsn, +static bool fanotify_should_merge(struct fsnotify_event *old_fsn, struct fsnotify_event *new_fsn) { struct fanotify_event *old, *new; @@ -129,7 +129,7 @@ static int fanotify_merge(struct list_head *list, struct fsnotify_event *event) return 0; list_for_each_entry_reverse(test_event, list, list) { - if (should_merge(test_event, event)) { + if (fanotify_should_merge(test_event, event)) { FANOTIFY_E(test_event)->mask |= new->mask; return 1; } From patchwork Tue May 12 18:17:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 11543729 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3EC05139F for ; Tue, 12 May 2020 18:17:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 278FA20714 for ; Tue, 12 May 2020 18:17:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729271AbgELSRr (ORCPT ); Tue, 12 May 2020 14:17:47 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:26549 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726300AbgELSRr (ORCPT ); Tue, 12 May 2020 14:17:47 -0400 IronPort-SDR: ROQLGba36rQBfJwvHnvLW47/ccwB3RyK0+20xl7Syr62SWeufBQz9H5aAjyjjd+g8AIuVFv6Ug 4xB05T8YRMoKspb+NuuggNiEOSd+i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8sbp6q5AwFP0oYk7hayFzmm384DknkJN19FYxGHjojvO17QPPD0F+ywjEq0nDdx2//GJqHhAonKLnXbkrfuZ6py601HxQoo0NBf/IxbBqsdL/PyQkXxrsDXDgclMwyoxObqEM9y1oYfWWKVAKKUPqLSsVuT6+IgJumDfo4VuDLnJ/c54P7uiGczmUUBcqmxwZsXdHe4E+xiI0WYZ3rsn9gAHX4EvgolUePllkOCXiBXZ3upQaI86S80CJi8AYfAWI+tmrqB0zm/HpFMYWBGEF+MG2/yd4qYQ/cMdD6SIsh5nzwKT7euUIEh2Aq1tA/5y7tnKPTb+jECuZ34ytcmr9HUwBM7/j9cFNmG3ieGXSU8l2YJXWBt3aRXrkl0y1PF2q990NJCEtkGyfpDUw48fbDGwuB3EdH5WUqVcN6DRn69QcSgDC13RN9nkIxGWFp0B9j31kOL5CGtGbJAz7E= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BKBwAE57pe/xCltltmhHqBZBIsjSWFfIwYkVgLAQEBAQEBAQEBNAECBAEBhESCBCc4EwIDAQEBAwIFAQEGAQEBAQEBBAQBbAQBAQcKAgGETiEBAwEBBQoBQ4I7IoNCCwEjI09wEoMmglgpsT0zhVGDV4FAgTiHXYUBgUE/hF+KQgSya4JUgnGVKwwdnTqQHZ87IoFWTSAYgyRQGA2fCkIwNwIGCAEBAwlXASIBjggBAQ X-IPAS-Result: A2BKBwAE57pe/xCltltmhHqBZBIsjSWFfIwYkVgLAQEBAQEBAQEBNAECBAEBhESCBCc4EwIDAQEBAwIFAQEGAQEBAQEBBAQBbAQBAQcKAgGETiEBAwEBBQoBQ4I7IoNCCwEjI09wEoMmglgpsT0zhVGDV4FAgTiHXYUBgUE/hF+KQgSya4JUgnGVKwwdnTqQHZ87IoFWTSAYgyRQGA2fCkIwNwIGCAEBAwlXASIBjggBAQ Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO biggussolus.home) ([91.182.165.16]) by relay.skynet.be with ESMTP; 12 May 2020 20:17:45 +0200 From: Fabian Frederick To: jack@suse.cz, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, Fabian Frederick Subject: [PATCH V2 2/6 linux-next] notify: explicit shutdown initialization Date: Tue, 12 May 2020 20:17:40 +0200 Message-Id: <20200512181740.405774-1-fabf@skynet.be> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org kzalloc should already do it but explicitly initialize group shutdown variable to false. Signed-off-by: Fabian Frederick --- fs/notify/group.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/notify/group.c b/fs/notify/group.c index 133f723aca07..f2cba2265061 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c @@ -130,6 +130,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops) INIT_LIST_HEAD(&group->notification_list); init_waitqueue_head(&group->notification_waitq); group->max_events = UINT_MAX; + group->shutdown = false; mutex_init(&group->mark_mutex); INIT_LIST_HEAD(&group->marks_list); From patchwork Tue May 12 18:18:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 11543731 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6657F92A for ; Tue, 12 May 2020 18:18:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5818220714 for ; Tue, 12 May 2020 18:18:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730952AbgELSSK (ORCPT ); Tue, 12 May 2020 14:18:10 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:26587 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726300AbgELSSK (ORCPT ); Tue, 12 May 2020 14:18:10 -0400 IronPort-SDR: Kyn4xYby3BztO1uLKn1HLcsQr2f0KuC6Oz/BnuClbNQTsknOMVdeuoqnAn89T9l7IKtS7x7isj tIlhIa1QMfGRuNnvvfsh+GZTqayB1los43JVgGuQecoO75UY9GfhRY5M7CvDC74OiEDFi12ugR q2mqzi8t0umX9GY9obTPhPv2cNjnxFBTsQgs2su42zrvR0pWm+Na7xqrW+ovPcd1I75yvLa6ys X02dx8abase9ZvVAu/jUHA+WDtjgwlKJbQzPL3QjoG/O81jZx5F3ukeuMP+wiZtSQq/7ZIBH8b 6pU= X-Belgacom-Dynamic: yes IronPort-PHdr: 9a23:V/EkSBapINfSme96pxLrUYz/LSx+4OfEezUN459isYplN5qZrsiybnLW6fgltlLVR4KTs6sC17OL9fG6EjVZsd6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vLBi6twHcutcZjYd/N6o8yQbCr2dVdehR2W5mP0+YkQzm5se38p5j8iBQtOwk+sVdT6j0fLk2QKJBAjg+PG87+MPktR/YTQuS/XQcSXkZkgBJAwfe8h73WIr6vzbguep83CmaOtD2TawxVD+/4apnVAPkhSEaPDM/7WrZiNF/jLhDrRyhuRJx3oDaboKSOvVxca3QZs8WSGlbU8pNTSFNHp+wYo0SBOQBJ+ZYqIz9qkMOoxSkHgasBfngyjlVjXH2x601zfkuHh/c3AwhA90Os2nfodL7NKgISu+1wrLFzS7Ab/JW3zfy9pTIfgo6rv6SRL99d9faxkYzGQ3flFqQtZDlMC2P1uQLq2WV4eltWOavhWMmqwx9vDaiyMcxh4XVm44Z1lHJ+yp2zosoK9C1VlN2bN6mHZZOuC+WK4V4TMwmTm9ouCg21LkLtJimdyYJ0JQq3xrSZ+Gdf4SV4R/vSvydLSp5iX9lYr6zmhe//E69wePm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FAgTiHXYUBgUE/hF+KQgSya4JUgnGVKwwdgkuab5AdnzsigVZNIBiDJFAYDZBMF44nQjA3AgYIAQEDCVcBIgGOCAEB Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO biggussolus.home) ([91.182.165.16]) by relay.skynet.be with ESMTP; 12 May 2020 20:18:08 +0200 From: Fabian Frederick To: jack@suse.cz, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, Fabian Frederick Subject: [PATCH V2 3/6 linux-next] notify: add mutex destroy Date: Tue, 12 May 2020 20:18:03 +0200 Message-Id: <20200512181803.405832-1-fabf@skynet.be> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org destroy mutex before group kfree Signed-off-by: Fabian Frederick --- fs/notify/group.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/notify/group.c b/fs/notify/group.c index f2cba2265061..0a2dc03d13eb 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c @@ -25,6 +25,7 @@ static void fsnotify_final_destroy_group(struct fsnotify_group *group) group->ops->free_group_priv(group); mem_cgroup_put(group->memcg); + mutex_destroy(&group->mark_mutex); kfree(group); } From patchwork Tue May 12 18:18:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 11543733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 157D592A for ; Tue, 12 May 2020 18:18:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0774F206D3 for ; Tue, 12 May 2020 18:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730993AbgELSSu (ORCPT ); Tue, 12 May 2020 14:18:50 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:26638 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730978AbgELSSt (ORCPT ); Tue, 12 May 2020 14:18:49 -0400 IronPort-SDR: naegeXBE5vTA3AgOLAzPnFpZ0cCOHR74wGPOWbxeBh16rXhY5FRJsDcaEe3rJO4rILeWPQQ1BX MH02uVrBIC6dhxCqKwez6Xe9wgt2m/XtskSmSkx2z70w65tcj6kaorDXHY/ChSq/mPGuGEJu0v DOIFJHEPdvzzYFmuwvfiSPkCBOr0LNi0ICI7ogzs99WdgXbUJicHTEwFGAhnGiSnAJ9NM6wUeR uAWWlPDJ7z5Ha+DTmMJSh3Z+t7hMKQrjthknRnPsO3+pRBYnkhtBIwOy2FSFH9GtJjEivnoZbA SXc= X-Belgacom-Dynamic: yes IronPort-PHdr: 9a23:ABwaFxF2njoKgT/tnRozVp1GYnF86YWxBRYc798ds5kLTJ7yo8SwAkXT6L1XgUPTWs2DsrQY0reQ4vqrADVQqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba5yIRmsqQjdqMYajZZ/Jqsy1xDEvmZGd+NKyG1yOFmdhQz85sC+/J5i9yRfpfcs/NNeXKv5Yqo1U6VWACwpPG4p6sLrswLDTRaU6XsHTmoWiBtIDBPb4xz8Q5z8rzH1tut52CmdIM32UbU5Uims4qt3VBPljjoMOjgk+2/Vl8NwlrpWrhK/qRJizYDaY4abO/VxcK7GYd8XRnBMUtpLWiBdHo+xaZYEAeobPeZfqonwv1sAogGlCgmtHuzvzCJDiH/s3aIkzusuDxvG3A08ENINrX/Zq9v1O70JXuC716TI1jbDbvNQ2Tjj9IjEaAsuru+VUL92bMHexlUhGRnfgVWMtYzqISmV1uIVvmaV7OdtUeKhhm8npg1vrDWhxtohhpXUio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BgV6CKIFkEiyNJYV8jBiKMoU/gWcLAQEBAQEBAQEBNAECBAEBhESCBCc4EwIDAQEBAwIFAQEGAQEBAQEBBAQBbAQBAQcKAgGETiEBAwEBBQoBQ4I7IoNNASMjT3ASgyaCWCmxcIVRg1eBQIE4AYdchQGBQT+EX4QVH4YOBLJrglSCcZUrDB2dOi2PcJ87IoFWTSAYgyRQGA2fCkIwNwIGCAEBAwlXASIBi0OCRQEB Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO biggussolus.home) ([91.182.165.16]) by relay.skynet.be with ESMTP; 12 May 2020 20:18:46 +0200 From: Fabian Frederick To: jack@suse.cz, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, Fabian Frederick Subject: [PATCH V2 4/6 linux-next] fanotify: remove reference to fill_event_metadata() Date: Tue, 12 May 2020 20:18:36 +0200 Message-Id: <20200512181836.405879-1-fabf@skynet.be> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org fill_event_metadata() was removed in commit bb2f7b4542c7 ("fanotify: open code fill_event_metadata()") Signed-off-by: Fabian Frederick --- fs/notify/fanotify/fanotify_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 42cb794c62ac..02a314acc757 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -328,7 +328,7 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, ret = -EFAULT; /* * Sanity check copy size in case get_one_event() and - * fill_event_metadata() event_len sizes ever get out of sync. + * event_len sizes ever get out of sync. */ if (WARN_ON_ONCE(metadata.event_len > count)) goto out_close_fd; From patchwork Tue May 12 18:19:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 11543737 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7680692A for ; Tue, 12 May 2020 18:19:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6511C20714 for ; Tue, 12 May 2020 18:19:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730687AbgELSTo (ORCPT ); Tue, 12 May 2020 14:19:44 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:26694 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725950AbgELSTn (ORCPT ); Tue, 12 May 2020 14:19:43 -0400 IronPort-SDR: QwZxF3PihmMKDV85CkDhGk+l7HWubEZEZ7MZ5zuKkFcs8411iQAqMzbwzeBuHBDVnqrFi3OJ9V CACHe5bE6zV/AZaR1eXoU0mVSyCPzdQfq6+Or/0D6PLNvjjVLF5DVMDbpwziV8uzoVeI/E0i72 Jlmg6hfpDjj+O7ErukuXp/sxVLOFo7q1kDhanQ1kjjtZPIctaeMoD6x4n0V9TAEPhs0Msq8OQX 4SX0fsx1hieXeVfOItppXTLtFd7yEKGrrPEx5oJVJ92RdPWOoCUqhreJZFENajX8O/mSG5Ynw7 GiM= X-Belgacom-Dynamic: yes IronPort-PHdr: 9a23:UgcCOhSZzK9T29BvLtqnI/LXXNpsv+yvbD5Q0YIujvd0So/mwa6zYByN2/xhgRfzUJnB7Loc0qyK6v2mCDZLuM/R+Fk5M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe7x/IAi2oAnLssQan4RuJrssxhbKv3BFZ/lYyWR0KFyJgh3y/N2w/Jlt8yRRv/Iu6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spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CsCgB56Lpe/xCltltmglKCKIFkEiyNJYV+jBiRWAsBAQEBAQEBAQE0AQIEAQGERIIEJzkFDQIDAQEBAwIFAQEGAQEBAQEBBAQBbAQBAQcKAgGETiEBAwEBBQoBQ4I7IoNNASMjT3ASgyaCWCmxc4VRg1GBQIE4h12FAYFBP4RfhBWGLQSya4JUgnGVKwwdgkuaby2PcJ88IYFWTSAYgyRQGA2fCkIwNwIGCAEBAwlXASIBi0OCRQEB X-IPAS-Result: A2CsCgB56Lpe/xCltltmglKCKIFkEiyNJYV+jBiRWAsBAQEBAQEBAQE0AQIEAQGERIIEJzkFDQIDAQEBAwIFAQEGAQEBAQEBBAQBbAQBAQcKAgGETiEBAwEBBQoBQ4I7IoNNASMjT3ASgyaCWCmxc4VRg1GBQIE4h12FAYFBP4RfhBWGLQSya4JUgnGVKwwdgkuaby2PcJ88IYFWTSAYgyRQGA2fCkIwNwIGCAEBAwlXASIBi0OCRQEB Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO biggussolus.home) ([91.182.165.16]) by relay.skynet.be with ESMTP; 12 May 2020 20:19:12 +0200 From: Fabian Frederick To: jack@suse.cz, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, Fabian Frederick Subject: [PATCH V2 5/6 linux-next] fsnotify/fdinfo: remove proc_fs.h inclusion Date: Tue, 12 May 2020 20:19:06 +0200 Message-Id: <20200512181906.405927-1-fabf@skynet.be> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org proc_fs.h was already included in fdinfo.h Signed-off-by: Fabian Frederick --- fs/notify/fdinfo.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c index ef83f4020554..f0d6b54be412 100644 --- a/fs/notify/fdinfo.c +++ b/fs/notify/fdinfo.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include "inotify/inotify.h" From patchwork Tue May 12 18:19:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 11543739 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 833E792A for ; Tue, 12 May 2020 18:19:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 751E820714 for ; Tue, 12 May 2020 18:19:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730712AbgELSTp (ORCPT ); Tue, 12 May 2020 14:19:45 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:26711 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726300AbgELSTo (ORCPT ); Tue, 12 May 2020 14:19:44 -0400 IronPort-SDR: +0kegYNzNUyQzv2uQu8pKdpA2imwc+KEVKzVpe9RcC70/rA29hfsA5Dv1ufFvfedozFk6W7NIN gr/BfhO/6n9KV7yWiVfGhByI4teZPzihz2OQ2jMOKDTPRbh5RS/OGEn5Ik6KOu/bWgfXVwwEhx WqdwACaKb7n9AW5UXRY7DtFeEy76+5j6KxzhtLhIVECVJxnMFRhSTGX5dkjw9+3bhMtf375w+i o7mypJxRHLh46/kwPD9E5ztxZwAT9Fex1C3yU1A7RfBiFGfJ6tLD819vrXYK6D/YscOYOQc8D9 J3Q= X-Belgacom-Dynamic: yes IronPort-PHdr: 9a23:N/WlexcXzUccqDqEwKMKjl/xlGMj4u6mDksu8pMizoh2WeGdxcW+bB7h7PlgxGXEQZ/co6odzbaP7uaxAydZuMfJmUtBWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+S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RHMw1moNRiVph6F7iUN4w1aHl6N/hq92D9tWst1AWAYzM9by1eF2BsrzUQGJKtmAQliOWda3BzwtCNg8lYxdK31hEsmv20iQlxGhBKUYwuSG X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BKBwB56Lpe/xCltltmhHqBZBIsjSWFfowYkVgLAQEBAQEBAQEBNAECBAEBhESCBCc4EwIDAQEBAwIFAQEGAQEBAQEBBAQBbAQBAQcKAgGETiEBAwEBBQoBQ4I7IoNCCwEjI09wEoMmglgpsUAzhVGDUYFAgTiHXYUBgUE/hF+KQgSya4JUgnGVKwwdnTqQHZ87IoFWTSAYgyRQGA2fCkIwNwIGCAEBAwlXASIBjggBAQ X-IPAS-Result: A2BKBwB56Lpe/xCltltmhHqBZBIsjSWFfowYkVgLAQEBAQEBAQEBNAECBAEBhESCBCc4EwIDAQEBAwIFAQEGAQEBAQEBBAQBbAQBAQcKAgGETiEBAwEBBQoBQ4I7IoNCCwEjI09wEoMmglgpsUAzhVGDUYFAgTiHXYUBgUE/hF+KQgSya4JUgnGVKwwdnTqQHZ87IoFWTSAYgyRQGA2fCkIwNwIGCAEBAwlXASIBjggBAQ Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO biggussolus.home) ([91.182.165.16]) by relay.skynet.be with ESMTP; 12 May 2020 20:19:39 +0200 From: Fabian Frederick To: jack@suse.cz, amir73il@gmail.com Cc: linux-fsdevel@vger.kernel.org, Fabian Frederick Subject: [PATCH V2 6/6 linux-next] fanotify: don't write with size under sizeof(response) Date: Tue, 12 May 2020 20:19:21 +0200 Message-Id: <20200512181921.405973-1-fabf@skynet.be> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org fanotify_write() only aligned copy_from_user size to sizeof(response) for higher values. This patch avoids all values below as suggested by Amir Goldstein and set to response size unconditionally. Signed-off-by: Fabian Frederick --- V2: don't write with size under sizeof(response), not only 0 fs/notify/fanotify/fanotify_user.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 02a314acc757..63b5dffdca9e 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -487,8 +487,10 @@ static ssize_t fanotify_write(struct file *file, const char __user *buf, size_t group = file->private_data; - if (count > sizeof(response)) - count = sizeof(response); + if (count < sizeof(response)) + return -EINVAL; + + count = sizeof(response); pr_debug("%s: group=%p count=%zu\n", __func__, group, count);