lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ac3eb2510811300441m2a551cc7nec0374bb7a707bb8@mail.gmail.com>
Date:	Sun, 30 Nov 2008 13:41:29 +0100
From:	"Kay Sievers" <kay.sievers@...y.org>
To:	"Al Viro" <viro@...iv.linux.org.uk>
Cc:	"Linus Torvalds" <torvalds@...ux-foundation.org>, gregkh@...e.de,
	petero2@...ia.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fix pktcdvd breakage from commit e105b8bfc769b0545b6f0f395179d1e43cbee822

On Sun, Nov 30, 2008 at 13:19, Al Viro <viro@...iv.linux.org.uk> wrote:
>        device_create() will create a symlink in /sys/dev/char unless
> the class has ->dev_kobj cleared; pktcdvd uses it to populate the
> /sys/class/pktcdvd/ with per-device subdirectories.  While we do
> want /sys/class/pktcdvd/pktcdvd[0-7]/dev to contain a device number,
> we definitely do not want it to try and crap into /sys/dev/char; if
> nothing else, device number is *block* one (and we don't want it
> to crap into /sys/dev/block either - there such symlinks will be created
> by add_disk() and they will point to /sys/block/pktcdvd[0-7]).
>
>        As it is, attempt to set the damn thing up will end up with
> sysfs_add_one() barfing at duplicate entries and /sys/class/pktcdvd/pktcdvd*/*/
> not created at all.  The fix is trivial: clear ->dev_kobj in the class to
> tell device_add() that no, we do *not* want these symlinks, TYVM...
>
>        FWIW, all traces containing pkt_setup_dev() on kerneloops.org appear
> to be from that one.  It had been around since 2.6.26; probably -stable
> fodder...
>
> Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
> ---
> diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
> index f20bf35..79981f2 100644
> --- a/drivers/block/pktcdvd.c
> +++ b/drivers/block/pktcdvd.c
> @@ -417,6 +417,7 @@ static int pkt_sysfs_init(void)
>                printk(DRIVER_NAME": failed to create class pktcdvd\n");
>                return ret;
>        }
> +       class_pktcdvd->dev_kobj = NULL;
>        return 0;
>  }

I posted a fix for that weeks ago. But the pktcdvd maintainer stated,
that the char device nodes are not used for anything. So the whole use
of dev_t should be removed entirely. They just blindly claim the same
char dev_t the block devices use, and conflict with char devices from
other subsystems. Patching out the /sys/dev/class links fixes the
oops, but the underlying fundamental breakage will still exist.

Original mail here states:
"Maybe, but that character device would not be used for anything,
besides creating sub-directories in /sys/class/pktcdvd. The driver
implements a block device, not a character device."

http://lkml.org/lkml/2008/10/14/318

No idea why this never got fixed.

Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ