{ "results": [ { "index": 0, "function": "refcount_warn_saturate", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff849eaa6f", "address_formatted": "0xffffffff849eaa6f (0xffffffff849ea9d0 + 0x9f)", "addr2line_address": "0xffffffff849eaa6f", "source": { "primary": { "function": "refcount_warn_saturate", "file": "lib/refcount.c", "line": 0 }, "inlined_frames": [] }, "function_source": null, "note": "addr2line returned line 0 for lib/refcount.c \u2014 DWARF may be incomplete at this address", "disasm": "ffffffff849eaa32:\tjne ffffffff849eaa9c \nffffffff849eaa34:\tcall ffffffff81c48110 <__sanitizer_cov_trace_pc>\nffffffff849eaa39:\tlea 0xad60190(%rip),%rdi # ffffffff8f74abd0 <__start___bug_table+0x83cd0>\nffffffff849eaa40:\tcall ffffffff8b280bd8 <__SCT__WARN_trap>\nffffffff849eaa45:\tjmp ffffffff849eaaad \nffffffff849eaa47:\ttest %ebx,%ebx\nffffffff849eaa49:\tje ffffffff849eaa89 \nffffffff849eaa4b:\tcmp $0x1,%ebx\nffffffff849eaa4e:\tjne ffffffff849eaa9c \nffffffff849eaa50:\tcall ffffffff81c48110 <__sanitizer_cov_trace_pc>\nffffffff849eaa55:\tlea 0xad60184(%rip),%rdi # ffffffff8f74abe0 <__start___bug_table+0x83ce0>\nffffffff849eaa5c:\tcall ffffffff8b280bd8 <__SCT__WARN_trap>\nffffffff849eaa61:\tjmp ffffffff849eaaad \nffffffff849eaa63:\tcall ffffffff81c48110 <__sanitizer_cov_trace_pc>\nffffffff849eaa68:\tlea 0xad60181(%rip),%rdi # ffffffff8f74abf0 <__start___bug_table+0x83cf0>\nffffffff849eaa6f:\tcall ffffffff8b280bd8 <__SCT__WARN_trap> <<< crash\nffffffff849eaa74:\tjmp ffffffff849eaaad \nffffffff849eaa76:\tcall ffffffff81c48110 <__sanitizer_cov_trace_pc>\nffffffff849eaa7b:\tlea 0xad6017e(%rip),%rdi # ffffffff8f74ac00 <__start___bug_table+0x83d00>\nffffffff849eaa82:\tcall ffffffff8b280bd8 <__SCT__WARN_trap>\nffffffff849eaa87:\tjmp ffffffff849eaaad " }, { "index": 1, "function": "kobject_get", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8b1ab49a", "address_formatted": "0xffffffff8b1ab49a (0xffffffff8b1ab3a0 + 0xfa)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8b1ab499", "source": { "primary": { "function": "__refcount_add", "file": "include/linux/refcount.h", "line": 0 }, "inlined_frames": [ { "function": "__refcount_inc", "file": "include/linux/refcount.h", "line": 366 }, { "function": "refcount_inc", "file": "include/linux/refcount.h", "line": 383 }, { "function": "kref_get", "file": "include/linux/kref.h", "line": 45 }, { "function": "kobject_get", "file": "lib/kobject.c", "line": 643 } ] }, "function_source": null, "note": "addr2line returned line 0 for include/linux/refcount.h \u2014 DWARF may be incomplete at this address" }, { "index": 2, "function": "i2c_get_adapter", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8742a42d", "address_formatted": "0xffffffff8742a42d (0xffffffff8742a3c0 + 0x6d)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8742a42c", "source": { "primary": { "function": "i2c_get_adapter", "file": "drivers/i2c/i2c-core-base.c", "line": 2612 }, "inlined_frames": [] }, "function_source": { "file": "drivers/i2c/i2c-core-base.c", "start_line": 2600, "end_line": 2619, "code": "EXPORT_SYMBOL_GPL(i2c_new_scanned_device);\n\nstruct i2c_adapter *i2c_get_adapter(int nr)\n{\n\tstruct i2c_adapter *adapter;\n\n\tmutex_lock(&core_lock);\n\tadapter = idr_find(&i2c_adapter_idr, nr);\n\tif (!adapter)\n\t\tgoto exit;\n\n\tif (try_module_get(adapter->owner))\n\t\tget_device(&adapter->dev);\n\telse\n\t\tadapter = NULL;\n\n exit:\n\tmutex_unlock(&core_lock);\n\treturn adapter;\n}\n" }, "git_blame_hashes": [ "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "438d6c2c015cf63bf7e9bdc2033d435433ac8455", "611e12ea0f121a31d9e9c4ce2a18a77abc2f28d6", "a0920e10438e9fe8b22aba607083347c84458ed8", "c1d084759c95ecd0ef08274654a1f6c4f343cdcd", "caada32afe0d181b1dc36ab3fc29628582776e09", "d735b34db30b7891ff76b552d18ecb0ce04a2bc2" ], "recent_commits": [ { "hash": "3c1d1613be80c", "subject": "i2c: remove i2c_new_probed_device API" }, { "hash": "c1d084759c95e", "subject": "i2c: replace i2c_new_probed_device with an ERR_PTR variant" }, { "hash": "611e12ea0f121", "subject": "i2c: core: manage i2c bus device refcount in i2c_[get|put]_adapter" }, { "hash": "d735b34db30b7", "subject": "i2c: make i2c_get_adapter prototype clearer" }, { "hash": "7225acf4aa285", "subject": "i2c-core: Fix some coding style issues" }, { "hash": "1cf92b453a405", "subject": "i2c: Remove void casts" }, { "hash": "caada32afe0d1", "subject": "i2c: Rename main mutex" }, { "hash": "12b5053ac5870", "subject": "i2c: Add i2c_new_probed_device()" }, { "hash": "438d6c2c015cf", "subject": "i2c: Whitespace cleanups" }, { "hash": "b3585e4f5b3e4", "subject": "[PATCH] I2C: Convert i2c to mutexes" } ] }, { "index": 3, "function": "i2cdev_open", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8743ec48", "address_formatted": "0xffffffff8743ec48 (0xffffffff8743ec00 + 0x48)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8743ec47", "source": { "primary": { "function": "i2cdev_open", "file": "drivers/i2c/i2c-dev.c", "line": 603 }, "inlined_frames": [] }, "function_source": { "file": "drivers/i2c/i2c-dev.c", "start_line": 593, "end_line": 625, "code": "#else\n#define compat_i2cdev_ioctl NULL\n#endif\n\nstatic int i2cdev_open(struct inode *inode, struct file *file)\n{\n\tunsigned int minor = iminor(inode);\n\tstruct i2c_client *client;\n\tstruct i2c_adapter *adap;\n\n\tadap = i2c_get_adapter(minor);\n\tif (!adap)\n\t\treturn -ENODEV;\n\n\t/* This creates an anonymous i2c_client, which may later be\n\t * pointed to some address using I2C_SLAVE or I2C_SLAVE_FORCE.\n\t *\n\t * This client is ** NEVER REGISTERED ** with the driver model\n\t * or I2C core code!! It just holds private copies of addressing\n\t * information and maybe a PEC flag.\n\t */\n\tclient = kzalloc_obj(*client);\n\tif (!client) {\n\t\ti2c_put_adapter(adap);\n\t\treturn -ENOMEM;\n\t}\n\tsnprintf(client->name, I2C_NAME_SIZE, \"i2c-dev %d\", adap->nr);\n\n\tclient->adapter = adap;\n\tfile->private_data = client;\n\n\treturn 0;\n}\n" }, "git_blame_hashes": [ "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "22f76e744dc41096987c6df8270b5c249511cde5", "5136ed4fcb05cd4981cc6034a11e66370ed84789", "7d5cb45655f2e9e37ef75d18f50c0072ef14a38b", "907135aaa0cc120a347222c8f274ecc5ca0db641", "9669f54194b4df34c96478d696d9ba2b977545f5", "bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43" ], "recent_commits": [ { "hash": "bf4afc53b77ae", "subject": "Convert 'alloc_obj' family to use the new default GFP_KERNEL argument" }, { "hash": "69050f8d6d075", "subject": "treewide: Replace kmalloc with kmalloc_obj for non-scalar types" }, { "hash": "7d5cb45655f2e", "subject": "i2c compat ioctls: move to ->compat_ioctl()" }, { "hash": "5136ed4fcb05c", "subject": "i2c-dev: don't get i2c adapter via i2c_dev" }, { "hash": "9ea3e941d161f", "subject": "i2c-dev: Use standard bus notification mechanism" }, { "hash": "9669f54194b4d", "subject": "i2c: Remove big kernel lock from i2cdev_open" }, { "hash": "3db633ee352bf", "subject": "i2c: cdev lock_kernel() pushdown" }, { "hash": "907135aaa0cc1", "subject": "i2c-dev: \"how does it work\" comments" }, { "hash": "22f76e744dc41", "subject": "i2c-dev: Drop the client template" }, { "hash": "1da177e4c3f41", "subject": "Linux-2.6.12-rc2" } ] }, { "index": 4, "function": "chrdev_open", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff82392340", "address_formatted": "0xffffffff82392340 (0xffffffff82391e70 + 0x4d0)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8239233f", "source": { "primary": { "function": "chrdev_open", "file": "fs/char_dev.c", "line": 411 }, "inlined_frames": [] }, "function_source": { "file": "fs/char_dev.c", "start_line": 366, "end_line": 421, "code": "\n/*\n * Called every time a character special file is opened\n */\nstatic int chrdev_open(struct inode *inode, struct file *filp)\n{\n\tconst struct file_operations *fops;\n\tstruct cdev *p;\n\tstruct cdev *new = NULL;\n\tint ret = 0;\n\n\tspin_lock(&cdev_lock);\n\tp = inode->i_cdev;\n\tif (!p) {\n\t\tstruct kobject *kobj;\n\t\tint idx;\n\t\tspin_unlock(&cdev_lock);\n\t\tkobj = kobj_lookup(cdev_map, inode->i_rdev, &idx);\n\t\tif (!kobj)\n\t\t\treturn -ENXIO;\n\t\tnew = container_of(kobj, struct cdev, kobj);\n\t\tspin_lock(&cdev_lock);\n\t\t/* Check i_cdev again in case somebody beat us to it while\n\t\t we dropped the lock. */\n\t\tp = inode->i_cdev;\n\t\tif (!p) {\n\t\t\tinode->i_cdev = p = new;\n\t\t\tlist_add(&inode->i_devices, &p->list);\n\t\t\tnew = NULL;\n\t\t} else if (!cdev_get(p))\n\t\t\tret = -ENXIO;\n\t} else if (!cdev_get(p))\n\t\tret = -ENXIO;\n\tspin_unlock(&cdev_lock);\n\tcdev_put(new);\n\tif (ret)\n\t\treturn ret;\n\n\tret = -ENXIO;\n\tfops = fops_get(p->ops);\n\tif (!fops)\n\t\tgoto out_cdev_put;\n\n\treplace_fops(filp, fops);\n\tif (filp->f_op->open) {\n\t\tret = filp->f_op->open(inode, filp);\n\t\tif (ret)\n\t\t\tgoto out_cdev_put;\n\t}\n\n\treturn 0;\n\n out_cdev_put:\n\tcdev_put(p);\n\treturn ret;\n}\n" }, "git_blame_hashes": [ "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "1ff97647f066aef72ae68042c9abc4a837a12e6d", "922f9cfa79b52c85b6002d96cb0eefd13437c58c", "a30427d92d0bc152b833088e4a305bbeb1a0c162", "a518ab9329041411526ab8e05edfda7e2715244f", "e84f9e57b90ca89664d733a7cef19aa7ccd832f3" ], "recent_commits": [ { "hash": "e84f9e57b90ca", "subject": "consolidate the reassignments of ->f_op in ->open() instances" }, { "hash": "1ff97647f066a", "subject": "char_dev.c: fix up some whitespace errors" }, { "hash": "9fd5746fd3d78", "subject": "fs: Remove i_cindex from struct inode" }, { "hash": "a518ab9329041", "subject": "[PATCH] tidy up chrdev_open" }, { "hash": "9514dff918b94", "subject": "Remove the lock_kernel() call from chrdev_open()" }, { "hash": "a30427d92d0bc", "subject": "Add a comment in chrdev_open()" }, { "hash": "922f9cfa79b52", "subject": "fs/char_dev.c: chrdev_open marked static and removed from fs.h" }, { "hash": "1da177e4c3f41", "subject": "Linux-2.6.12-rc2" } ] }, { "index": 5, "function": "do_dentry_open", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8236e11d", "address_formatted": "0xffffffff8236e11d (0xffffffff8236d8e0 + 0x83d)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8236e11c", "source": { "primary": { "function": "do_dentry_open", "file": "fs/open.c", "line": 949 }, "inlined_frames": [] }, "function_source": { "file": "fs/open.c", "start_line": 886, "end_line": 1013, "code": "\nstatic int do_dentry_open(struct file *f,\n\t\t\t int (*open)(struct inode *, struct file *))\n{\n\tstatic const struct file_operations empty_fops = {};\n\tstruct inode *inode = f->f_path.dentry->d_inode;\n\tint error;\n\n\tpath_get(&f->f_path);\n\tf->f_inode = inode;\n\tf->f_mapping = inode->i_mapping;\n\tf->f_wb_err = filemap_sample_wb_err(f->f_mapping);\n\tf->f_sb_err = file_sample_sb_err(f);\n\n\tif (unlikely(f->f_flags & O_PATH)) {\n\t\tf->f_mode = FMODE_PATH | FMODE_OPENED;\n\t\tfile_set_fsnotify_mode(f, FMODE_NONOTIFY);\n\t\tf->f_op = &empty_fops;\n\t\treturn 0;\n\t}\n\n\tif ((f->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) {\n\t\ti_readcount_inc(inode);\n\t} else if (f->f_mode & FMODE_WRITE && !special_file(inode->i_mode)) {\n\t\terror = file_get_write_access(f);\n\t\tif (unlikely(error))\n\t\t\tgoto cleanup_file;\n\t\tf->f_mode |= FMODE_WRITER;\n\t}\n\n\t/* POSIX.1-2008/SUSv4 Section XSI 2.9.7 */\n\tif (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))\n\t\tf->f_mode |= FMODE_ATOMIC_POS;\n\n\tf->f_op = fops_get(inode->i_fop);\n\tif (WARN_ON(!f->f_op)) {\n\t\terror = -ENODEV;\n\t\tgoto cleanup_all;\n\t}\n\n\terror = security_file_open(f);\n\tif (unlikely(error))\n\t\tgoto cleanup_all;\n\n\t/*\n\t * Call fsnotify open permission hook and set FMODE_NONOTIFY_* bits\n\t * according to existing permission watches.\n\t * If FMODE_NONOTIFY mode was already set for an fanotify fd or for a\n\t * pseudo file, this call will not change the mode.\n\t */\n\terror = fsnotify_open_perm_and_set_mode(f);\n\tif (unlikely(error))\n\t\tgoto cleanup_all;\n\n\terror = break_lease(file_inode(f), f->f_flags);\n\tif (unlikely(error))\n\t\tgoto cleanup_all;\n\n\t/* normally all 3 are set; ->open() can clear them if needed */\n\tf->f_mode |= FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;\n\tif (!open)\n\t\topen = f->f_op->open;\n\tif (open) {\n\t\terror = open(inode, f);\n\t\tif (error)\n\t\t\tgoto cleanup_all;\n\t}\n\tf->f_mode |= FMODE_OPENED;\n\tif ((f->f_mode & FMODE_READ) &&\n\t likely(f->f_op->read || f->f_op->read_iter))\n\t\tf->f_mode |= FMODE_CAN_READ;\n\tif ((f->f_mode & FMODE_WRITE) &&\n\t likely(f->f_op->write || f->f_op->write_iter))\n\t\tf->f_mode |= FMODE_CAN_WRITE;\n\tif ((f->f_mode & FMODE_LSEEK) && !f->f_op->llseek)\n\t\tf->f_mode &= ~FMODE_LSEEK;\n\tif (f->f_mapping->a_ops && f->f_mapping->a_ops->direct_IO)\n\t\tf->f_mode |= FMODE_CAN_ODIRECT;\n\n\tf->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);\n\tf->f_iocb_flags = iocb_flags(f);\n\n\tfile_ra_state_init(&f->f_ra, f->f_mapping->host->i_mapping);\n\n\tif ((f->f_flags & O_DIRECT) && !(f->f_mode & FMODE_CAN_ODIRECT))\n\t\treturn -EINVAL;\n\n\t/*\n\t * XXX: Huge page cache doesn't support writing yet. Drop all page\n\t * cache for this file before processing writes.\n\t */\n\tif (f->f_mode & FMODE_WRITE) {\n\t\t/*\n\t\t * Depends on full fence from get_write_access() to synchronize\n\t\t * against collapse_file() regarding i_writecount and nr_thps\n\t\t * updates. Ensures subsequent insertion of THPs into the page\n\t\t * cache will fail.\n\t\t */\n\t\tif (filemap_nr_thps(inode->i_mapping)) {\n\t\t\tstruct address_space *mapping = inode->i_mapping;\n\n\t\t\tfilemap_invalidate_lock(inode->i_mapping);\n\t\t\t/*\n\t\t\t * unmap_mapping_range just need to be called once\n\t\t\t * here, because the private pages is not need to be\n\t\t\t * unmapped mapping (e.g. data segment of dynamic\n\t\t\t * shared libraries here).\n\t\t\t */\n\t\t\tunmap_mapping_range(mapping, 0, 0, 0);\n\t\t\ttruncate_inode_pages(mapping, 0);\n\t\t\tfilemap_invalidate_unlock(inode->i_mapping);\n\t\t}\n\t}\n\n\treturn 0;\n\ncleanup_all:\n\tif (WARN_ON_ONCE(error > 0))\n\t\terror = -EINVAL;\n\tfops_put(f->f_op);\n\tput_file_access(f);\ncleanup_file:\n\tpath_put(&f->f_path);\n\tf->__f_path.mnt = NULL;\n\tf->__f_path.dentry = NULL;\n\tf->f_inode = NULL;\n\treturn error;\n}\n" }, "git_blame_hashes": [ "02e5180d991f203441687cecd0b7e6a2ba0a34d3", "08da98e1b2f76cdbacf84b9affaa75960dbce515", "09d91cda0e8207c1f14ee0d572f61a53dbcdaf85", "0f4a2cebe256dab4e9b8836b87ce4c909cd585eb", "164f4064ca81eefcea29f7f5dcf394f92be1d0c0", "1abf0c718f15a56a0a435588d1b104c7a37dc9bd", "1cda52f1b4611f4daa9d89e69d9428fb4137dc3f", "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "293bc9822fa9b3c9d4b7893bcb241e085580771a", "2a42754b3104d78a2bc7a2ad8844427411c76ca6", "2be7d348fe924f0c5583c6a805bd42cecda93104", "2f7d98f10b8f64525b2c74cae7d70ae5278eb654", "3f4d5a00076b7e340625a2014cb83e10bf0d6dd1", "4bacc9c9234c7c8eec44f5ed4e960d9f96fa0f01", "55fc0d91746759c71bc165bba62a2db64ac98e35", "5660e13d2fd6af1903d4b0b98020af95ca2d638a", "6b4e8085c0004382b985a5c005c685073630e746", "7159d54418e0a1a3df91e74501363a1c05379517", "72c2d53192004845cbc19cd8a30b3212a9288140", "735e4ae5ba28c886d249ad04d3c8cc097dad6336", "788e7dd4c22e6f41b3a118fd8c291f831f6fddbb", "7f7f25e82d54870df24d415a7007fbd327da027b", "834f2a4a1554dc5b2598038b3fe8703defcbe467", "83bc1d294130cc471a89ce10770daa281a93fcb0", "83f936c75e3689a63253d89c47a4d239c56d7410", "8436318205b9f29e45db88850ec60e326327e241", "8468e937df1f31411d1e127fa38db064af051fe5", "8e3447822d7d8c0f562c6851a7a31e24d1ede55e", "95101401bb50ae2cf9deee1bbf4d2b28d0dfdc26", "96b7e579addd3cdc806c1667bf5b6b126070827c", "a2ad63daa88b9d6846976fd2a0b5e4f5cfc58377", "a94204f4d48e28a711b7ed10399f749286c433e3", "ae2bb293a3e8adbc54d08cede5afc22929030c03", "af04fadcaa932d2d804699409d9d96dd5d85ce7f", "b5bcdda32736b94a7d178d156d80a69f536ad468", "c65454a947263dfdf482076388aaed60af84ca2f", "d6da19c9cace63290ccfccb1fc35151ffefc0bec", "dd37978c50bc8b354e5c4633f69387f16572fdac", "e3f20ae21079ecac282df65d83865c5771f4bca0", "e41c1f42919b01649ddea25b95eaa72dce2d591a", "e7478158e1378325907edfdd960eca98a1be405b", "ea73ea7279884ba80896d4ea0f0443bf48b9e311", "eb6ecbed0aa27360712d0674bf132843a9567344", "f3c7691e8d30d88899b514675c7c86d19057b5fd", "f5d11409e61dadf1f9af91b22bbedc28a60a2e2c" ], "recent_commits": [ { "hash": "e41c1f42919b0", "subject": "fs: touch predicts in do_dentry_open()" }, { "hash": "2f7d98f10b8f6", "subject": "Have cc(1) catch attempts to modify ->f_path" }, { "hash": "08da98e1b2f76", "subject": "fsnotify: merge file_set_fsnotify_mode_from_watchers() with open perm hook" }, { "hash": "2a42754b3104d", "subject": "fsnotify: disable notification by default for all pseudo files" }, { "hash": "95101401bb50a", "subject": "fsnotify: use accessor to set FMODE_NONOTIFY_*" }, { "hash": "a94204f4d48e2", "subject": "fsnotify: opt-in for permission events at file open time" }, { "hash": "1cda52f1b4611", "subject": "fsnotify, lsm: Decouple fsnotify from lsm" }, { "hash": "b051320d6ab8c", "subject": "Merge tag 'vfs-6.11.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs" }, { "hash": "8e3447822d7d8", "subject": "vfs: remove redundant smp_mb for thp handling in do_dentry_open" }, { "hash": "7d1cf5e624ef5", "subject": "vfs: generate FS_CREATE before FS_OPEN when ->atomic_open used." } ] }, { "index": 6, "function": "vfs_open", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8236edbb", "address_formatted": "0xffffffff8236edbb (0xffffffff8236ed80 + 0x3b)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8236edba", "source": { "primary": { "function": "vfs_open", "file": "fs/open.c", "line": 1081 }, "inlined_frames": [] }, "function_source": { "file": "fs/open.c", "start_line": 1069, "end_line": 1091, "code": "EXPORT_SYMBOL(file_path);\n\n/**\n * vfs_open - open the file at the given path\n * @path: path to open\n * @file: newly allocated file with f_flag initialized\n */\nint vfs_open(const struct path *path, struct file *file)\n{\n\tint ret;\n\n\tfile->__f_path = *path;\n\tret = do_dentry_open(file, NULL);\n\tif (!ret) {\n\t\t/*\n\t\t * Once we return a file with FMODE_OPENED, __fput() will call\n\t\t * fsnotify_close(), so we need fsnotify_open() here for\n\t\t * symmetry.\n\t\t */\n\t\tfsnotify_open(file);\n\t}\n\treturn ret;\n}\n" }, "git_blame_hashes": [ "2f7d98f10b8f64525b2c74cae7d70ae5278eb654", "4bacc9c9234c7c8eec44f5ed4e960d9f96fa0f01", "7d1cf5e624ef5d81b933e8b7f4927531166c0f7a", "9bf39ab2adafd7cf8740859cb49e7b7952813a5d", "ae2bb293a3e8adbc54d08cede5afc22929030c03" ], "recent_commits": [ { "hash": "2f7d98f10b8f6", "subject": "Have cc(1) catch attempts to modify ->f_path" }, { "hash": "7d1cf5e624ef5", "subject": "vfs: generate FS_CREATE before FS_OPEN when ->atomic_open used." }, { "hash": "0f4a2cebe256d", "subject": "do_dentry_open(): kill inode argument" }, { "hash": "55650b2fddb95", "subject": "fs/open.c: Fix W=1 kernel doc warnings" }, { "hash": "a6518f73e60e5", "subject": "vfs: don't open real" }, { "hash": "ae2bb293a3e8a", "subject": "get rid of cred argument of vfs_open() and do_dentry_open()" }, { "hash": "495e642939114", "subject": "vfs: add flags to d_real()" }, { "hash": "2d902671ce1cd", "subject": "vfs: merge .d_select_inode() into .d_real()" }, { "hash": "54d5ca871e72f", "subject": "vfs: add vfs_select_inode() helper" }, { "hash": "9bf39ab2adafd", "subject": "vfs: add file_path() helper" } ] }, { "index": 7, "function": "path_openat", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff823bc223", "address_formatted": "0xffffffff823bc223 (0xffffffff823b93e0 + 0x2e43)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff823bc222", "source": { "primary": { "function": "do_open", "file": "fs/namei.c", "line": 4677 }, "inlined_frames": [ { "function": "path_openat", "file": "fs/namei.c", "line": 4836 } ] }, "function_source": { "file": "fs/namei.c", "start_line": 4629, "end_line": 4689, "code": "\n/*\n * Handle the last step of open()\n */\nstatic int do_open(struct nameidata *nd,\n\t\t struct file *file, const struct open_flags *op)\n{\n\tstruct mnt_idmap *idmap;\n\tint open_flag = op->open_flag;\n\tbool do_truncate;\n\tint acc_mode;\n\tint error;\n\n\tif (!(file->f_mode & (FMODE_OPENED | FMODE_CREATED))) {\n\t\terror = complete_walk(nd);\n\t\tif (error)\n\t\t\treturn error;\n\t}\n\tif (!(file->f_mode & FMODE_CREATED))\n\t\taudit_inode(nd->name, nd->path.dentry, 0);\n\tidmap = mnt_idmap(nd->path.mnt);\n\tif (open_flag & O_CREAT) {\n\t\tif ((open_flag & O_EXCL) && !(file->f_mode & FMODE_CREATED))\n\t\t\treturn -EEXIST;\n\t\tif (d_is_dir(nd->path.dentry))\n\t\t\treturn -EISDIR;\n\t\terror = may_create_in_sticky(idmap, nd,\n\t\t\t\t\t d_backing_inode(nd->path.dentry));\n\t\tif (unlikely(error))\n\t\t\treturn error;\n\t}\n\tif ((nd->flags & LOOKUP_DIRECTORY) && !d_can_lookup(nd->path.dentry))\n\t\treturn -ENOTDIR;\n\n\tdo_truncate = false;\n\tacc_mode = op->acc_mode;\n\tif (file->f_mode & FMODE_CREATED) {\n\t\t/* Don't check for write permission, don't truncate */\n\t\topen_flag &= ~O_TRUNC;\n\t\tacc_mode = 0;\n\t} else if (d_is_reg(nd->path.dentry) && open_flag & O_TRUNC) {\n\t\terror = mnt_want_write(nd->path.mnt);\n\t\tif (error)\n\t\t\treturn error;\n\t\tdo_truncate = true;\n\t}\n\terror = may_open(idmap, &nd->path, acc_mode, open_flag);\n\tif (!error && !(file->f_mode & FMODE_OPENED))\n\t\terror = vfs_open(&nd->path, file);\n\tif (!error)\n\t\terror = security_file_post_open(file, op->acc_mode);\n\tif (!error && do_truncate)\n\t\terror = handle_truncate(idmap, file);\n\tif (unlikely(error > 0)) {\n\t\tWARN_ON(1);\n\t\terror = -EINVAL;\n\t}\n\tif (do_truncate)\n\t\tmnt_drop_write(nd->path.mnt);\n\treturn error;\n}\n" }, "git_blame_hashes": [ "0f9d1a10c341020617e5b1c7f9c16f6a070438ec", "30aba6656f61ed44cba445a3c0d38b296fa9e8f5", "3ad5615a071f7c1c41b2e23b9ffde73b09499eb0", "44b1d53043c482225196e8a9cd9f35163a1b3336", "4609e1f18e19c3b302e1eb4858334bca1532f780", "5a2d3edd8dad8c8870419c614e3a7449effe87cb", "6c0d46c493217cf48999b3f8808910ae534aa085", "8795e7d48288163ce29eb927240a0c32c40b4d54", "8f46ff5767b0b18329140d80d6bcabd818f42c4c", "973d4b73fbaf705f8fa5208234175606df0999e4", "abf08576afe31506b812c8c1be9714f78613f300", "b94e0b32c899914f045ddf05949517d64fd32499", "c5971b8c6354a95c9ee7eb722928af5000bac247", "c80567c82ae4814a41287618e315a60ecf513be6", "c981a4828125e4a5832a726761343cbff8810674", "e67fe63341b8117d7e0d9acf0f1222d5138b9266", "fb1cc555d533869910e20de4b8d5147570afdfad", "ff326a3299660e46d4eb8876b217fee38638281a" ], "recent_commits": [ { "hash": "cd3cec0a02c73", "subject": "ima: Move to LSM infrastructure" }, { "hash": "8f46ff5767b0b", "subject": "security: Introduce file_post_open hook" }, { "hash": "e67fe63341b81", "subject": "fs: port i_{g,u}id_into_vfs{g,u}id() to mnt_idmap" }, { "hash": "4609e1f18e19c", "subject": "fs: port ->permission() to pass mnt_idmap" }, { "hash": "abf08576afe31", "subject": "fs: port vfs_*() helpers to struct mnt_idmap" }, { "hash": "549c7297717c3", "subject": "fs: make helpers idmap mount aware" }, { "hash": "ba73d98745be1", "subject": "namei: handle idmapped mounts in may_*() helpers" }, { "hash": "ff326a3299660", "subject": "open_last_lookups(): move complete_walk() into do_open()" }, { "hash": "b94e0b32c8999", "subject": "open_last_lookups(): lift O_EXCL|O_CREAT handling into do_open()" }, { "hash": "c5971b8c6354a", "subject": "take post-lookup part of do_last() out of loop" } ] }, { "index": 8, "function": "do_file_open", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff823b916e", "address_formatted": "0xffffffff823b916e (0xffffffff823b8f30 + 0x23e)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff823b916d", "source": { "primary": { "function": "do_file_open", "file": "fs/namei.c", "line": 0 }, "inlined_frames": [] }, "function_source": null, "note": "addr2line returned line 0 for fs/namei.c \u2014 DWARF may be incomplete at this address" }, { "index": 9, "function": "do_sys_openat2", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff823701a3", "address_formatted": "0xffffffff823701a3 (0xffffffff82370090 + 0x113)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff823701a2", "source": { "primary": { "function": "do_sys_openat2", "file": "fs/open.c", "line": 0 }, "inlined_frames": [] }, "function_source": null, "note": "addr2line returned line 0 for fs/open.c \u2014 DWARF may be incomplete at this address" }, { "index": 10, "function": "__x64_sys_openat", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff82370698", "address_formatted": "0xffffffff82370698 (0xffffffff82370560 + 0x138)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff82370697", "source": { "primary": { "function": "do_sys_open", "file": "fs/open.c", "line": 1372 }, "inlined_frames": [ { "function": "__do_sys_openat", "file": "fs/open.c", "line": 1388 }, { "function": "__se_sys_openat", "file": "fs/open.c", "line": 1383 }, { "function": "__x64_sys_openat", "file": "fs/open.c", "line": 1383 } ] }, "function_source": { "file": "fs/open.c", "start_line": 1368, "end_line": 1373, "code": "\nint do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)\n{\n\tstruct open_how how = build_open_how(flags, mode);\n\treturn do_sys_openat2(dfd, filename, &how);\n}\n" }, "git_blame_hashes": [ "29d80d506b18384f64a54b01fae78184e2d327f3", "e922efc342d565a38eed3af377ff403f52148864", "fddb5d430ad9fa91b49b1d34d0202ffe2fa0e179" ], "recent_commits": [ { "hash": "29d80d506b183", "subject": "open: Fix return type of several functions from long to int" }, { "hash": "fddb5d430ad9f", "subject": "open: introduce openat2(2) syscall" }, { "hash": "2cf0966683430", "subject": "make SYSCALL_DEFINE-generated wrappers do asmlinkage_protect" }, { "hash": "a218d0fdc5f90", "subject": "switch open and mkdir syscalls to umode_t" }, { "hash": "ca013e945b1ba", "subject": "[CVE-2009-0029] System call wrappers part 17" }, { "hash": "385910f2b275a", "subject": "x86: be careful about tailcall breakage for sys_open[at] too" }, { "hash": "e922efc342d56", "subject": "[PATCH] remove duplicated sys_open32() code from 64bit archs" } ] }, { "index": 11, "function": "do_syscall_64", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff8b23c1cd", "address_formatted": "0xffffffff8b23c1cd (0xffffffff8b23c080 + 0x14d)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8b23c1cc", "source": { "primary": { "function": "do_syscall_x64", "file": "arch/x86/entry/syscall_64.c", "line": 63 }, "inlined_frames": [ { "function": "do_syscall_64", "file": "arch/x86/entry/syscall_64.c", "line": 94 } ] }, "function_source": { "file": "arch/x86/entry/syscall_64.c", "start_line": 51, "end_line": 67, "code": "#endif\n\nstatic __always_inline bool do_syscall_x64(struct pt_regs *regs, int nr)\n{\n\t/*\n\t * Convert negative numbers to very high and thus out of range\n\t * numbers for comparisons.\n\t */\n\tunsigned int unr = nr;\n\n\tif (likely(unr < NR_syscalls)) {\n\t\tunr = array_index_nospec(unr, NR_syscalls);\n\t\tregs->ax = x64_sys_call(regs, unr);\n\t\treturn true;\n\t}\n\treturn false;\n}\n" }, "git_blame_hashes": [ "01dfb4805420291966b75b208d66c88c62579649", "21832247f2df4f636b0f2ae6939819e8dd2ed35f" ], "recent_commits": [ { "hash": "21832247f2df4", "subject": "x86/syscall/x32: Move x32 syscall table" }, { "hash": "01dfb48054202", "subject": "x86/syscall/64: Move 64-bit syscall dispatch code" } ] }, { "index": 12, "function": "entry_SYSCALL_64_after_hwframe", "module": "vmlinux", "function_type": "normal", "address_computed": "0xffffffff81000130", "address_formatted": "0xffffffff81000130 (0xffffffff810000b9 + 0x77)", "addr2line_correction": "-1 (return address)", "addr2line_address": "0xffffffff8100012f", "source": { "primary": { "function": "entry_SYSCALL_64_after_hwframe", "file": "arch/x86/entry/entry_64.S", "line": 121 }, "inlined_frames": [] }, "function_source": { "file": "arch/x86/entry/entry_64.S", "start_line": 81, "end_line": 181, "code": " *\n * When user can change pt_regs->foo always force IRET. That is because\n * it deals with uncanonical addresses better. SYSRET has trouble\n * with them due to bugs in both AMD and Intel CPUs.\n */\n\nSYM_CODE_START(entry_SYSCALL_64)\n\tUNWIND_HINT_ENTRY\n\tENDBR\n\n\tswapgs\n\t/* tss.sp2 is scratch space. */\n\tmovq\t%rsp, PER_CPU_VAR(cpu_tss_rw + TSS_sp2)\n\tSWITCH_TO_KERNEL_CR3 scratch_reg=%rsp\n\tmovq\tPER_CPU_VAR(cpu_current_top_of_stack), %rsp\n\nSYM_INNER_LABEL(entry_SYSCALL_64_safe_stack, SYM_L_GLOBAL)\n\tANNOTATE_NOENDBR\n\n\t/* Construct struct pt_regs on stack */\n\tpushq\t$__USER_DS\t\t\t\t/* pt_regs->ss */\n\tpushq\tPER_CPU_VAR(cpu_tss_rw + TSS_sp2)\t/* pt_regs->sp */\n\tpushq\t%r11\t\t\t\t\t/* pt_regs->flags */\n\tpushq\t$__USER_CS\t\t\t\t/* pt_regs->cs */\n\tpushq\t%rcx\t\t\t\t\t/* pt_regs->ip */\nSYM_INNER_LABEL(entry_SYSCALL_64_after_hwframe, SYM_L_GLOBAL)\n\tpushq\t%rax\t\t\t\t\t/* pt_regs->orig_ax */\n\n\tPUSH_AND_CLEAR_REGS rax=$-ENOSYS\n\n\t/* IRQs are off. */\n\tmovq\t%rsp, %rdi\n\t/* Sign extend the lower 32bit as syscall numbers are treated as int */\n\tmovslq\t%eax, %rsi\n\n\t/* clobbers %rax, make sure it is after saving the syscall nr */\n\tIBRS_ENTER\n\tUNTRAIN_RET\n\tCLEAR_BRANCH_HISTORY\n\n\tcall\tdo_syscall_64\t\t/* returns with IRQs disabled */\n\n\t/*\n\t * Try to use SYSRET instead of IRET if we're returning to\n\t * a completely clean 64-bit userspace context. If we're not,\n\t * go to the slow exit path.\n\t * In the Xen PV case we must use iret anyway.\n\t */\n\n\tALTERNATIVE \"testb %al, %al; jz swapgs_restore_regs_and_return_to_usermode\", \\\n\t\t\"jmp swapgs_restore_regs_and_return_to_usermode\", X86_FEATURE_XENPV\n\n\t/*\n\t * We win! This label is here just for ease of understanding\n\t * perf profiles. Nothing jumps here.\n\t */\nsyscall_return_via_sysret:\n\tIBRS_EXIT\n\tPOP_REGS pop_rdi=0\n\n\t/*\n\t * Now all regs are restored except RSP and RDI.\n\t * Save old stack pointer and switch to trampoline stack.\n\t */\n\tmovq\t%rsp, %rdi\n\tmovq\tPER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp\n\tUNWIND_HINT_END_OF_STACK\n\n\tpushq\tRSP-RDI(%rdi)\t/* RSP */\n\tpushq\t(%rdi)\t\t/* RDI */\n\n\t/*\n\t * We are on the trampoline stack. All regs except RDI are live.\n\t * We can do future final exit work right here.\n\t */\n\tSTACKLEAK_ERASE_NOCLOBBER\n\n\tSWITCH_TO_USER_CR3_STACK scratch_reg=%rdi\n\n\tpopq\t%rdi\n\tpopq\t%rsp\nSYM_INNER_LABEL(entry_SYSRETQ_unsafe_stack, SYM_L_GLOBAL)\n\tANNOTATE_NOENDBR\n\tswapgs\n\tCLEAR_CPU_BUFFERS\n\tsysretq\nSYM_INNER_LABEL(entry_SYSRETQ_end, SYM_L_GLOBAL)\n\tANNOTATE_NOENDBR\n\tint3\nSYM_CODE_END(entry_SYSCALL_64)\n\n/*\n * %rdi: prev task\n * %rsi: next task\n */\n.pushsection .text, \"ax\"\nSYM_FUNC_START(__switch_to_asm)\n\tANNOTATE_NOENDBR\n\t/*\n\t * Save callee-saved registers\n\t * This must match the order in inactive_task_frame\n" }, "git_blame_hashes": [ "0100301bfdf56a2a370c7157b5ab0fbf9313e1cd", "0595494891723a1dcca5eaa8eeca8ab54ad953b9", "0bd7b79851d0f74b24a9ce87d088f2e7c718f668", "1b331eeea7b8676fc5dbdf80d0a07e41be226177", "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2", "1e423bff959e48166f5b7efca01fdb0dbdf05846", "26ba4e5738a544aa17c462bfbe580e74071c810b", "2dbb887e875b1de3ca8f40ddf26bcfe55798c609", "30907fd13bb593202574bb20af58d67c70a1ee14", "385f72c83eb609652f02dc9ee415520c23bda629", "3c7501722e6b31a6e56edd23cea5e77dbb9ffd1a", "3e3b9293d392c577b62e24e4bc9982320438e749", "3e5e7f7736b05d5fdf2cc4e0ba4f2d8bc42c630d", "47f33de4aafb2f5e43d480d590a939d0f1d566a9", "4d7321381e5c7102a3d3faf0a0a0035a09619612", "4fbb39108f972437c44e5ffa781b56635d496826", "582077c94052bd69a544b3f9d7619c9c6a67c34b", "6fd166aae78c0ab738d49bda653cbd9e3b1491cf", "72fe4858544292ad64600765cb78bc02298c6b1c", "7390db8aea0d64e9deb28b8e1ce716f5020c7ee5", "7bf36bbc5e0c09271f9efe22162f8cc3f8ebd3d2", "7fcb3bc361c724a75bc642dbdd9d9bf0bdf07260", "8a055d7f411d41755ce30db5bb65b154777c4b78", "8a9949bc71a71b3dd633255ebe8f8869b1f73474", "8f93402b92d443573d310250efa0b7f352fec992", "96c64806b4bf35f5edb465cafa6cec490e424a30", "98f05b5138f0a9b56022295cc1387e635b25635d", "9ed8e7d86061e7c3fb3855358d51ba4abb19ceb1", "a09a6e2399ba0595c3042b3164f3ca68a3cff33e", "a13644f3a53de4e95a7bce6459f834e832ea44c5", "afaef01c001537fa97a25092d7f54d764dc7d8c1", "afd30525a659ac0ae0904f0cb4a2ca75522c3123", "b9f6976bfb949121bb6e1e6f4fd9909735729148", "bc7b11c04ee9c9b0451ebf85bf64e0de69fdbb17", "bf904d2762ee6fc1e4acfcb0772bbfb4a27ad8a6", "c482feefe1aeb150156248ba0fd3e029bc886605", "ca282b486a570a0bfda5c1a4595ace7fa14243bf", "ce6565282b3b16fd850c6a676f78c6bc76d0c235", "e8d61bdf0fdfaeaf35fb5a63d6e67e60038b88e0", "fb799447ae2974a07907906dff5bd4b9e47b7123", "fffbb5dcfd29f8831e41b4dd2ab938bd36d35283" ], "recent_commits": [ { "hash": "385f72c83eb60", "subject": "x86/percpu: Move top_of_stack to percpu hot section" }, { "hash": "582077c94052b", "subject": "x86/cfi: Clean up linkage" }, { "hash": "7390db8aea0d6", "subject": "x86/bhi: Add support for clearing branch history at syscall entry" }, { "hash": "3c7501722e6b3", "subject": "x86/entry_64: Add VERW just before userspace transition" }, { "hash": "ca282b486a570", "subject": "x86/entry/64: Convert SYSRET validation tests to C" }, { "hash": "eb43c9b1517b4", "subject": "x86/entry/64: Remove obsolete comment on tracing vs. SYSRET" }, { "hash": "fb799447ae297", "subject": "x86,objtool: Split UNWIND_HINT_EMPTY in two" }, { "hash": "c063a217bc072", "subject": "x86/percpu: Move current_top_of_stack next to current_task" }, { "hash": "a09a6e2399ba0", "subject": "objtool: Add entry UNRET validation" }, { "hash": "2dbb887e875b1", "subject": "x86/entry: Add kernel IBRS implementation" } ] } ] }