C: read filp->private_data of filepointer in kernel module
I'am wondering if it is possible to read the private_data of a filepointer?
Or is it really "private"?!

I am in a kernel module!



    struct file *intercepted_fp;

    intercepted_fp = filp_open("/dev/snd/pcmC0D0p_bak", O_RDWR, (S_IRWXU | S_IRWXG | S_IRWXO));
        
    if (intercepted_fp == NULL) {
        LOGI("Cannot open intercepted device!");
        return -ENODEV;
    }

    mm_segment_t old_fs = get_fs();
    set_fs(get_ds());
        
    LOGI("private data: %p", intercepted_fp->private_data); // -> prints "private data: ffffffff"
    LOGI("buffer: %d", ((struct snd_pcm_file*) intercepted_fp->private_data)->substream->runtime->buffer_size); // ->  Unable to handle kernel paging request at virtual address ffffffff
    set_fs(old_fs);

C: read filp->private_data of filepointer in kernel module
===

I'am wondering if it is possible to read the private_data of a filepointer?
Or is it really "private"?!

I am in a kernel module!



    struct file *intercepted_fp;

    intercepted_fp = filp_open("/dev/snd/pcmC0D0p_bak", O_RDWR, (S_IRWXU | S_IRWXG | S_IRWXO));
        
    if (intercepted_fp == NULL) {
        LOGI("Cannot open intercepted device!");
        return -ENODEV;
    }

    mm_segment_t old_fs = get_fs();
    set_fs(get_ds());
        
    LOGI("private data: %p", intercepted_fp->private_data); // -> prints "private data: ffffffff"
    LOGI("buffer: %d", ((struct snd_pcm_file*) intercepted_fp->private_data)->substream->runtime->buffer_size); // ->  Unable to handle kernel paging request at virtual address ffffffff
    set_fs(old_fs);
