From: "Rantala, Tommi T. (Nokia - FI/Espoo)" <tommi.t.rantala@nokia.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 4.19 43/92] do_last(): fetch directory ->i_mode and ->i_uid before its too late
Date: Fri, 31 Jan 2020 10:08:37 +0000 [thread overview]
Message-ID: <5cbe397b7f7bb0f8bd579080c8a4c41d7b359632.camel@nokia.com> (raw)
In-Reply-To: <20200128135814.584735840@linuxfoundation.org>
On Tue, 2020-01-28 at 15:08 +0100, Greg Kroah-Hartman wrote:
> From: Al Viro <viro@zeniv.linux.org.uk>
>
> commit d0cb50185ae942b03c4327be322055d622dc79f6 upstream.
>
> may_create_in_sticky() call is done when we already have dropped the
> reference to dir.
>
> Fixes: 30aba6656f61e (namei: allow restricted O_CREAT of FIFOs and
> regular files)
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> fs/namei.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> --- a/fs/namei.c
> +++ b/fs/namei.c
> [...]
> @@ -3258,6 +3259,8 @@ static int do_last(struct nameidata *nd,
> struct file *file, const struct open_flags *op)
> {
> struct dentry *dir = nd->path.dentry;
> + kuid_t dir_uid = dir->d_inode->i_uid;
I hit the following oops in 4.19.100 while running kselftests.
fs/namei.c:3262 matches the line above.
Any ideas?
-Tommi
[ 224.682489] test_firmware: batched loading 'tmp.YlpRSimRmc' custom
fallback mechanism 4 times
[ 224.686656] misc test_firmware: Direct firmware load for tmp.YlpRSimRmc
failed with error -2
[ 224.691091] misc test_firmware: Direct firmware load for tmp.YlpRSimRmc
failed with error -2
[ 228.593757] Scheduler tracepoints stat_sleep, stat_iowait, stat_blocked
and stat_runtime require the kernel parameter schedstats=enable or
kernel.sched_schedstats=1
[ 239.451836] BUG: unable to handle kernel NULL pointer dereference at
0000000000000004
[ 239.460454] PGD 0 P4D 0
[ 239.461875] Oops: 0000 [#1] SMP PTI
[ 239.463696] CPU: 0 PID: 13450 Comm: ftracetest Not tainted 4.19.100-
1.x86_64 #1
[ 239.467604] Hardware name: Red Hat OpenStack Compute, BIOS 1.11.0-2.el7
04/01/2014
[ 239.471254] RIP: 0010:path_openat (fs/namei.c:3262 fs/namei.c:3537)
[ 239.482135] RSP: 0018:ffffb301c10e7cf8 EFLAGS: 00010246
[ 239.484757] RAX: 0000000000000000 RBX: ffff99a8f57e1dc0 RCX:
0000000000000004
[ 239.488229] RDX: 0000000000000000 RSI: 0000000c00000000 RDI:
ffff99a881d49900
[ 239.507724] RBP: ffffb301c10e7de0 R08: ffffb301c10e7c44 R09:
61c8864680b583eb
[ 239.511222] R10: 8080807fffffffff R11: d0ffffff979c8b96 R12:
0000000000008241
[ 239.514709] R13: 0000000000000000 R14: ffff99a881d49900 R15:
ffffb301c10e7eec
[ 239.518287] FS: 00007f1bda771740(0000) GS:ffff99a8f7a00000(0000)
knlGS:0000000000000000
[ 239.522233] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 239.524964] CR2: 0000000000000004 CR3: 00000001c2196005 CR4:
00000000001606f0
[ 239.528309] DR0: 0000000000405118 DR1: 0000000000000000 DR2:
0000000000000000
[ 239.531599] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000600
[ 239.534946] Call Trace:
[ 239.536265] ? __switch_to_asm (arch/x86/entry/entry_64.S:374)
[ 239.538164] do_filp_open (fs/namei.c:3568)
[ 239.539885] ? __switch_to_asm (arch/x86/entry/entry_64.S:374)
[ 239.541747] ? __switch_to_asm (arch/x86/entry/entry_64.S:374)
[ 239.543633] do_sys_open (fs/open.c:1089)
[ 239.545392] do_syscall_64 (arch/x86/entry/common.c:293)
[ 239.547204] ? prepare_exit_to_usermode (arch/x86/entry/common.c:198)
[ 239.549424] entry_SYSCALL_64_after_hwframe
(arch/x86/entry/entry_64.S:247)
[ 239.551815] RIP: 0033:0x7f1bda86617b
[ 239.561833] RSP: 002b:00007fffbd62ff10 EFLAGS: 00000246 ORIG_RAX:
0000000000000101
[ 239.565335] RAX: ffffffffffffffda RBX: 0000559cde8e9480 RCX:
00007f1bda86617b
[ 239.568576] RDX: 0000000000000241 RSI: 0000559cde908d90 RDI:
00000000ffffff9c
[ 239.571810] RBP: 0000559cde908d90 R08: 0000000000000000 R09:
0000000000000020
[ 239.575054] R10: 00000000000001b6 R11: 0000000000000246 R12:
0000000000000241
[ 239.578277] R13: 0000000000000000 R14: 0000000000000001 R15:
0000559cde908d90
[ 239.581512] Modules linked in: test_firmware kvm_intel kvm irqbypass
sch_fq_codel pcbc aesni_intel aes_x86_64 crypto_simd cryptd glue_helper
ata_piix dm_mirror dm_region_hash dm_log dm_mod autofs4
[ 239.589275] CR2: 0000000000000004
[ 239.590972] ---[ end trace 4b84bf2ccd45a421 ]---
[ 239.593205] RIP: 0010:path_openat (fs/namei.c:3262 fs/namei.c:3537)
[ 239.603919] RSP: 0018:ffffb301c10e7cf8 EFLAGS: 00010246
[ 239.606473] RAX: 0000000000000000 RBX: ffff99a8f57e1dc0 RCX:
0000000000000004
[ 239.609775] RDX: 0000000000000000 RSI: 0000000c00000000 RDI:
ffff99a881d49900
[ 239.613014] RBP: ffffb301c10e7de0 R08: ffffb301c10e7c44 R09:
61c8864680b583eb
[ 239.616244] R10: 8080807fffffffff R11: d0ffffff979c8b96 R12:
0000000000008241
[ 239.619457] R13: 0000000000000000 R14: ffff99a881d49900 R15:
ffffb301c10e7eec
[ 239.622911] FS: 00007f1bda771740(0000) GS:ffff99a8f7a00000(0000)
knlGS:0000000000000000
[ 239.626611] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 239.629254] CR2: 0000000000000004 CR3: 00000001c2196005 CR4:
00000000001606f0
[ 239.632512] DR0: 0000000000405118 DR1: 0000000000000000 DR2:
0000000000000000
[ 239.635745] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000600
[ 243.805958] trace_kprobe: Parse error at argument[0]. (-22)
[ 243.879983] trace_probe: x64 type has no corresponding fetch method.
[ 243.882922] trace_kprobe: Parse error at argument[0]. (-22)
> + umode_t dir_mode = dir->d_inode->i_mode;
> int open_flag = op->open_flag;
> bool will_truncate = (open_flag & O_TRUNC) != 0;
> bool got_write = false;
> @@ -3393,7 +3396,7 @@ finish_open:
> error = -EISDIR;
> if (d_is_dir(nd->path.dentry))
> goto out;
> - error = may_create_in_sticky(dir,
> + error = may_create_in_sticky(dir_mode, dir_uid,
> d_backing_inode(nd-
> >path.dentry));
> if (unlikely(error))
> goto out;
>
>
next prev parent reply other threads:[~2020-01-31 10:08 UTC|newest]
Thread overview: 99+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-28 14:07 [PATCH 4.19 00/92] 4.19.100-stable review Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 01/92] can, slip: Protect tty->disc_data in write_wakeup and close with RCU Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 02/92] firestream: fix memory leaks Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 03/92] gtp: make sure only SOCK_DGRAM UDP sockets are accepted Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 04/92] ipv6: sr: remove SKB_GSO_IPXIP6 on End.D* actions Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 05/92] net: bcmgenet: Use netif_tx_napi_add() for TX NAPI Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 06/92] net: cxgb3_main: Add CAP_NET_ADMIN check to CHELSIO_GET_MEM Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 07/92] net: ip6_gre: fix moving ip6gre between namespaces Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 08/92] net, ip6_tunnel: fix namespaces move Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 09/92] net, ip_tunnel: " Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 10/92] net: rtnetlink: validate IFLA_MTU attribute in rtnl_create_link() Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 11/92] net_sched: fix datalen for ematch Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 12/92] net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 13/92] net-sysfs: fix netdev_queue_add_kobject() breakage Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 14/92] net-sysfs: Call dev_hold always in netdev_queue_add_kobject Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 15/92] net-sysfs: Call dev_hold always in rx_queue_add_kobject Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 16/92] net-sysfs: Fix reference count leak Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 17/92] net: usb: lan78xx: Add .ndo_features_check Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 18/92] Revert "udp: do rmem bulk free even if the rx sk queue is empty" Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 19/92] tcp_bbr: improve arithmetic division in bbr_update_bw() Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 20/92] tcp: do not leave dangling pointers in tp->highest_sack Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 21/92] tun: add mutex_unlock() call and napi.skb clearing in tun_get_user() Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 22/92] afs: Fix characters allowed into cell names Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 23/92] hwmon: (adt7475) Make volt2reg return same reg as reg2volt input Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 24/92] hwmon: (core) Do not use device managed functions for memory allocations Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 25/92] PCI: Mark AMD Navi14 GPU rev 0xc5 ATS as broken Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 26/92] tracing: trigger: Replace unneeded RCU-list traversals Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 27/92] Input: keyspan-remote - fix control-message timeouts Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 28/92] Revert "Input: synaptics-rmi4 - dont increment rmiaddr for SMBus transfers" Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 29/92] ARM: 8950/1: ftrace/recordmcount: filter relocation types Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 30/92] mmc: tegra: fix SDR50 tuning override Greg Kroah-Hartman
2020-01-28 14:07 ` [PATCH 4.19 31/92] mmc: sdhci: fix minimum clock rate for v3 controller Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 32/92] Documentation: Document arm64 kpti control Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 33/92] Input: pm8xxx-vib - fix handling of separate enable register Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 34/92] Input: sur40 - fix interface sanity checks Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 35/92] Input: gtco - fix endpoint sanity check Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 36/92] Input: aiptek " Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 37/92] Input: pegasus_notetaker " Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 38/92] Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_register Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 39/92] netfilter: nft_osf: add missing check for DREG attribute Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 40/92] hwmon: (nct7802) Fix voltage limits to wrong registers Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 41/92] scsi: RDMA/isert: Fix a recently introduced regression related to logout Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 42/92] tracing: xen: Ordered comparison of function pointers Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 43/92] do_last(): fetch directory ->i_mode and ->i_uid before its too late Greg Kroah-Hartman
2020-01-31 10:08 ` Rantala, Tommi T. (Nokia - FI/Espoo) [this message]
2020-01-31 12:20 ` Al Viro
2020-01-31 13:57 ` Rantala, Tommi T. (Nokia - FI/Espoo)
2020-01-28 14:08 ` [PATCH 4.19 44/92] net/sonic: Add mutual exclusion for accessing shared state Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 45/92] net/sonic: Clear interrupt flags immediately Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 46/92] net/sonic: Use MMIO accessors Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 47/92] net/sonic: Fix interface error stats collection Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 48/92] net/sonic: Fix receive buffer handling Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 49/92] net/sonic: Avoid needless receive descriptor EOL flag updates Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 50/92] net/sonic: Improve receive descriptor status flag check Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 51/92] net/sonic: Fix receive buffer replenishment Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 52/92] net/sonic: Quiesce SONIC before re-initializing descriptor memory Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 53/92] net/sonic: Fix command register usage Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 54/92] net/sonic: Fix CAM initialization Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 55/92] net/sonic: Prevent tx watchdog timeout Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 56/92] tracing: Use hist triggers var_ref array to destroy var_refs Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 57/92] tracing: Remove open-coding of hist trigger var_ref management Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 58/92] tracing: Fix histogram code when expression has same var as value Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 59/92] sd: Fix REQ_OP_ZONE_REPORT completion handling Greg Kroah-Hartman
2020-01-28 18:02 ` Pavel Machek
2020-01-28 18:15 ` Greg Kroah-Hartman
2020-01-29 1:05 ` Damien Le Moal
2020-01-28 14:08 ` [PATCH 4.19 60/92] crypto: geode-aes - switch to skcipher for cbc(aes) fallback Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 61/92] coresight: etb10: Do not call smp_processor_id from preemptible Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 62/92] coresight: tmc-etf: " Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 63/92] libertas: Fix two buffer overflows at parsing bss descriptor Greg Kroah-Hartman
2020-01-29 22:47 ` Pavel Machek
2020-01-28 14:08 ` [PATCH 4.19 64/92] media: v4l2-ioctl.c: zero reserved fields for S/TRY_FMT Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 65/92] scsi: iscsi: Avoid potential deadlock in iscsi_if_rx func Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 66/92] netfilter: ipset: use bitmap infrastructure completely Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 67/92] netfilter: nf_tables: add __nft_chain_type_get() Greg Kroah-Hartman
2020-01-28 18:13 ` Pavel Machek
2020-01-28 14:08 ` [PATCH 4.19 68/92] net/x25: fix nonblocking connect Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 69/92] mm/memory_hotplug: make remove_memory() take the device_hotplug_lock Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 70/92] mm, sparse: drop pgdat_resize_lock in sparse_add/remove_one_section() Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 71/92] mm, sparse: pass nid instead of pgdat to sparse_add_one_section() Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 72/92] drivers/base/memory.c: remove an unnecessary check on NR_MEM_SECTIONS Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 73/92] mm, memory_hotplug: add nid parameter to arch_remove_memory Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 74/92] mm/memory_hotplug: release memory resource after arch_remove_memory() Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 75/92] drivers/base/memory.c: clean up relics in function parameters Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 76/92] mm, memory_hotplug: update a comment in unregister_memory() Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 77/92] mm/memory_hotplug: make unregister_memory_section() never fail Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 78/92] mm/memory_hotplug: make __remove_section() " Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 79/92] powerpc/mm: Fix section mismatch warning Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 80/92] mm/memory_hotplug: make __remove_pages() and arch_remove_memory() never fail Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 88/92] mm/hotplug: kill is_dev_zone() usage in __remove_pages() Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 89/92] drivers/base/node.c: simplify unregister_memory_block_under_nodes() Greg Kroah-Hartman
2020-01-28 14:08 ` [PATCH 4.19 91/92] mm/memory_hotplug: fix try_offline_node() Greg Kroah-Hartman
2020-01-28 14:09 ` [PATCH 4.19 92/92] mm/memory_hotplug: shrink zones when offlining memory Greg Kroah-Hartman
2020-01-28 23:03 ` [PATCH 4.19 00/92] 4.19.100-stable review shuah
2020-01-29 4:54 ` Naresh Kamboju
2020-01-29 11:31 ` Pavel Machek
2020-01-29 12:57 ` Greg Kroah-Hartman
2020-01-29 13:16 ` Jon Hunter
2020-01-29 14:43 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5cbe397b7f7bb0f8bd579080c8a4c41d7b359632.camel@nokia.com \
--to=tommi.t.rantala@nokia.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®