public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/28184] New: task_fd_lookup failed on linux 5.11
@ 2021-08-04  2:47 lijunlong at openresty dot com
  2021-08-05  2:55 ` [Bug tapsets/28184] " lijunlong at openresty dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: lijunlong at openresty dot com @ 2021-08-04  2:47 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=28184

            Bug ID: 28184
           Summary: task_fd_lookup failed on linux 5.11
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: lijunlong at openresty dot com
  Target Milestone: ---

Created attachment 13589
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13589&action=edit
fcheck_files

linux 5.11, fcheck_files was removed and replace by the following functions.

the patch in the attachment solve this problem.

``` c
/*
 * The caller must ensure that fd table isn't shared or hold rcu or file lock
 */
static inline struct file *files_lookup_fd_raw(struct files_struct *files,
unsigned int fd)
{
        struct fdtable *fdt = rcu_dereference_raw(files->fdt);

        if (fd < fdt->max_fds) {
                fd = array_index_nospec(fd, fdt->max_fds);
                return rcu_dereference_raw(fdt->fd[fd]);
        }
        return NULL;
}

static inline struct file *files_lookup_fd_locked(struct files_struct *files,
unsigned int fd)
{
        RCU_LOCKDEP_WARN(!lockdep_is_held(&files->file_lock),
                           "suspicious rcu_dereference_check() usage");
        return files_lookup_fd_raw(files, fd);
}

static inline struct file *files_lookup_fd_rcu(struct files_struct *files,
unsigned int fd)
{
        RCU_LOCKDEP_WARN(!rcu_read_lock_held(),
                           "suspicious rcu_dereference_check() usage");
        return files_lookup_fd_raw(files, fd);
}
```

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-19 18:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04  2:47 [Bug tapsets/28184] New: task_fd_lookup failed on linux 5.11 lijunlong at openresty dot com
2021-08-05  2:55 ` [Bug tapsets/28184] " lijunlong at openresty dot com
2021-08-05  2:56 ` lijunlong at openresty dot com
2021-08-06  2:25 ` lijunlong at openresty dot com
2021-08-19 18:02 ` scox at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).