public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "lijunlong at openresty dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug tapsets/28184] New: task_fd_lookup failed on linux 5.11
Date: Wed, 04 Aug 2021 02:47:11 +0000	[thread overview]
Message-ID: <bug-28184-6586@http.sourceware.org/bugzilla/> (raw)

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.

             reply	other threads:[~2021-08-04  2:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04  2:47 lijunlong at openresty dot com [this message]
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

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=bug-28184-6586@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).