From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969386AbdIZOPg (ORCPT ); Tue, 26 Sep 2017 10:15:36 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:37342 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968264AbdIZOPd (ORCPT ); Tue, 26 Sep 2017 10:15:33 -0400 X-Google-Smtp-Source: AOwi7QC0hVbCdiOanin9S43E32ps5Qn+gdSExjVDfLLqeLn/6+5sVmzdpAJ3JURf5/mceR/AmxiIRw== From: Salvatore Mesoraca To: linux-kernel@vger.kernel.org Cc: Kernel Hardening , Kees Cook , Solar Designer , Alexander Viro , "Eric W. Biederman" , linux-fsdevel@vger.kernel.org, Salvatore Mesoraca Subject: [RFC v2 0/2] Restrict dangerous open in sticky directories Date: Tue, 26 Sep 2017 16:14:31 +0200 Message-Id: <1506435273-8428-1-git-send-email-s.mesoraca16@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch-set introduces two separate features aimed at restricting dangerous open in world or group writable sticky directories. The purpose is to prevent exploitable bugs in user-space programs that don't access sticky directories in the proper way. The first patch prevents the O_CREAT open of FIFOs and regular files in world or group writable sticky directories if they already exists and are owned by someone else. The second patch prevents O_CREAT open in world or group writable sticky when the O_EXCL flag is not set, even if the file doesn't exist yet. More details can be found in respective commit messages. Salvatore Mesoraca (2): Protected FIFOs and regular files Protected O_CREAT open in sticky directory Documentation/sysctl/fs.txt | 66 +++++++++++++++++++++++++ fs/namei.c | 118 ++++++++++++++++++++++++++++++++++++++++++-- include/linux/fs.h | 3 ++ kernel/sysctl.c | 27 ++++++++++ 4 files changed, 211 insertions(+), 3 deletions(-) -- 1.9.1