<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/sysfs, branch v3.4.19</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/sysfs?h=v3.4.19</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/sysfs?h=v3.4.19'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-10-31T17:02:57Z</updated>
<entry>
<title>sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()</title>
<updated>2012-10-31T17:02:57Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2012-09-29T20:23:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fa3b39b05f40bf7273bcd6c152f0b59005b83480'/>
<id>urn:sha1:fa3b39b05f40bf7273bcd6c152f0b59005b83480</id>
<content type='text'>
commit 66081a72517a131430dcf986775f3268aafcb546 upstream.

The warning check for duplicate sysfs entries can cause a buffer overflow
when printing the warning, as strcat() doesn't check buffer sizes.
Use strlcat() instead.

Since strlcat() doesn't return a pointer to the passed buffer, unlike
strcat(), I had to convert the nested concatenation in sysfs_add_one() to
an admittedly more obscure comma operator construct, to avoid emitting code
for the concatenation if CONFIG_BUG is disabled.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>sysfs: handle 'parent deleted before child added'</title>
<updated>2012-04-10T21:48:51Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2012-04-06T20:41:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3a198886ab5f228fcbebb9ace803d8b99721d49a'/>
<id>urn:sha1:3a198886ab5f228fcbebb9ace803d8b99721d49a</id>
<content type='text'>
In scsi at least two cases of the parent device being deleted before the
child is added have been observed.

1/ scsi is performing async scans and the device is removed prior to the
   async can thread running (can happen with an in-opportune / unlikely
   unplug during initial scan).

2/ libsas discovery event running after the parent port has been torn
   down (this is a bug in libsas).

Result in crash signatures like:
 BUG: unable to handle kernel NULL pointer dereference at 0000000000000098
 IP: [&lt;ffffffff8115e100&gt;] sysfs_create_dir+0x32/0xb6
 ...
 Process scsi_scan_8 (pid: 5417, threadinfo ffff88080bd16000, task ffff880801b8a0b0)
 Stack:
  00000000fffffffe ffff880813470628 ffff88080bd17cd0 ffff88080614b7e8
  ffff88080b45c108 00000000fffffffe ffff88080bd17d20 ffffffff8125e4a8
  ffff88080bd17cf0 ffffffff81075149 ffff88080bd17d30 ffff88080614b7e8
 Call Trace:
  [&lt;ffffffff8125e4a8&gt;] kobject_add_internal+0x120/0x1e3
  [&lt;ffffffff81075149&gt;] ? trace_hardirqs_on+0xd/0xf
  [&lt;ffffffff8125e641&gt;] kobject_add_varg+0x41/0x50
  [&lt;ffffffff8125e70b&gt;] kobject_add+0x64/0x66
  [&lt;ffffffff8131122b&gt;] device_add+0x12d/0x63a

In this scenario the parent is still valid (because we have a
reference), but it has been device_del()'d which means its kobj-&gt;sd
pointer is NULL'd via:

 device_del()-&gt;kobject_del()-&gt;sysfs_remove_dir()

...and then sysfs_create_dir() (without this fix) goes ahead and
de-references parent_sd via sysfs_ns_type():

 return (sd-&gt;s_flags &amp; SYSFS_NS_TYPE_MASK) &gt;&gt; SYSFS_NS_TYPE_SHIFT;

This scenario is being fixed in scsi/libsas, but if other subsystems
present the same ordering the system need not immediately crash.

Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: James Bottomley &lt;JBottomley@parallels.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sysfs: Prevent crash on unset sysfs group attributes</title>
<updated>2012-04-10T21:48:51Z</updated>
<author>
<name>Bruno Prémont</name>
<email>bonbons@linux-vserver.org</email>
</author>
<published>2012-04-03T07:59:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5631f2c18f4b2845b3e97df1c659c5094a17605f'/>
<id>urn:sha1:5631f2c18f4b2845b3e97df1c659c5094a17605f</id>
<content type='text'>
Do not let the kernel crash when a device is registered with
sysfs while group attributes are not set (aka NULL).

Warn about the offender with some information about the offending
device.

This would warn instead of trying NULL pointer deref like:
 BUG: unable to handle kernel NULL pointer dereference at (null)
 IP: [&lt;ffffffff81152673&gt;] internal_create_group+0x83/0x1a0
 PGD 0
 Oops: 0000 [#1] SMP
 CPU 0
 Modules linked in:

 Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4
 RIP: 0010:[&lt;ffffffff81152673&gt;]  [&lt;ffffffff81152673&gt;] internal_create_group+0x83/0x1a0
 RSP: 0018:ffff88019485fd70  EFLAGS: 00010202
 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001
 RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60
 RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000
 R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00
 R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000
 FS:  0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000)
 Stack:
  ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908
  ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60
  0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be
 Call Trace:
  [&lt;ffffffff811527be&gt;] sysfs_create_group+0xe/0x10
  [&lt;ffffffff81376ca6&gt;] device_add_groups+0x46/0x80
  [&lt;ffffffff81377d3d&gt;] device_add+0x46d/0x6a0
  ...

Signed-off-by: Bruno Prémont &lt;bonbons@linux-vserver.org&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sysfs: Update the name hash for an entry after changing the namespace</title>
<updated>2012-04-09T22:33:00Z</updated>
<author>
<name>Tom Goff</name>
<email>thomas.goff@boeing.com</email>
</author>
<published>2012-04-04T19:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=70fa4a62e913dde2d100e0be2711562742f58bee'/>
<id>urn:sha1:70fa4a62e913dde2d100e0be2711562742f58bee</id>
<content type='text'>
This is needed to allow renaming network devices that have been moved
to another network namespace.

Signed-off-by: Tom Goff &lt;thomas.goff@boeing.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2012-03-21T20:36:41Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-21T20:36:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e2a0883e4071237d09b604a342c28b96b44a04b3'/>
<id>urn:sha1:e2a0883e4071237d09b604a342c28b96b44a04b3</id>
<content type='text'>
Pull vfs pile 1 from Al Viro:
 "This is _not_ all; in particular, Miklos' and Jan's stuff is not there
  yet."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits)
  ext4: initialization of ext4_li_mtx needs to be done earlier
  debugfs-related mode_t whack-a-mole
  hfsplus: add an ioctl to bless files
  hfsplus: change finder_info to u32
  hfsplus: initialise userflags
  qnx4: new helper - try_extent()
  qnx4: get rid of qnx4_bread/qnx4_getblk
  take removal of PF_FORKNOEXEC to flush_old_exec()
  trim includes in inode.c
  um: uml_dup_mmap() relies on -&gt;mmap_sem being held, but activate_mm() doesn't hold it
  um: embed -&gt;stub_pages[] into mmu_context
  gadgetfs: list_for_each_safe() misuse
  ocfs2: fix leaks on failure exits in module_init
  ecryptfs: make register_filesystem() the last potential failure exit
  ntfs: forgets to unregister sysctls on register_filesystem() failure
  logfs: missing cleanup on register_filesystem() failure
  jfs: mising cleanup on register_filesystem() failure
  make configfs_pin_fs() return root dentry on success
  configfs: configfs_create_dir() has parent dentry in dentry-&gt;d_parent
  configfs: sanitize configfs_create()
  ...
</content>
</entry>
<entry>
<title>switch open-coded instances of d_make_root() to new helper</title>
<updated>2012-03-21T01:29:35Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-01-09T03:15:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=48fde701aff662559b38d9a609574068f22d00fe'/>
<id>urn:sha1:48fde701aff662559b38d9a609574068f22d00fe</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>Revert "sysfs: Kill nlink counting."</title>
<updated>2012-03-08T21:03:10Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2012-03-08T21:03:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=54d20f006ceff1f2f1e69d0e54049b6c0765c039'/>
<id>urn:sha1:54d20f006ceff1f2f1e69d0e54049b6c0765c039</id>
<content type='text'>
This reverts commit 524b6c5b39b931311dfe5a2f5abae2f5c9731676.

It has shown to break userspace tools, which is not acceptable.

Reported-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sysfs: Fix memory leak in sysfs_sd_setsecdata().</title>
<updated>2012-02-24T22:25:49Z</updated>
<author>
<name>Masami Ichikawa</name>
<email>masami256@gmail.com</email>
</author>
<published>2012-02-20T22:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=93518dd2ebafcc761a8637b2877008cfd748c202'/>
<id>urn:sha1:93518dd2ebafcc761a8637b2877008cfd748c202</id>
<content type='text'>
This patch fixies follwing two memory leak patterns that reported by kmemleak.
sysfs_sd_setsecdata() is called during sys_lsetxattr() operation.
It checks sd-&gt;s_iattr is NULL or not. Then if it is NULL, it calls
sysfs_init_inode_attrs() to allocate memory.
That code is this.

iattrs = sd-&gt;s_iattr;
if (!iattrs)
                iattrs = sysfs_init_inode_attrs(sd);

The iattrs recieves sysfs_init_inode_attrs()'s result,  but sd-&gt;s_iattr
doesn't know the address. so it needs to set correct address to
sd-&gt;s_iattr to free memory in other function.

unreferenced object 0xffff880250b73e60 (size 32):
  comm "systemd", pid 1, jiffies 4294683888 (age 94.553s)
  hex dump (first 32 bytes):
    73 79 73 74 65 6d 5f 75 3a 6f 62 6a 65 63 74 5f  system_u:object_
    72 3a 73 79 73 66 73 5f 74 3a 73 30 00 00 00 00  r:sysfs_t:s0....
  backtrace:
    [&lt;ffffffff814cb1d0&gt;] kmemleak_alloc+0x73/0x98
    [&lt;ffffffff811270ab&gt;] __kmalloc+0x100/0x12c
    [&lt;ffffffff8120775a&gt;] context_struct_to_string+0x106/0x210
    [&lt;ffffffff81207cc1&gt;] security_sid_to_context_core+0x10b/0x129
    [&lt;ffffffff812090ef&gt;] security_sid_to_context+0x10/0x12
    [&lt;ffffffff811fb0da&gt;] selinux_inode_getsecurity+0x7d/0xa8
    [&lt;ffffffff811fb127&gt;] selinux_inode_getsecctx+0x22/0x2e
    [&lt;ffffffff811f4d62&gt;] security_inode_getsecctx+0x16/0x18
    [&lt;ffffffff81191dad&gt;] sysfs_setxattr+0x96/0x117
    [&lt;ffffffff811542f0&gt;] __vfs_setxattr_noperm+0x73/0xd9
    [&lt;ffffffff811543d9&gt;] vfs_setxattr+0x83/0xa1
    [&lt;ffffffff811544c6&gt;] setxattr+0xcf/0x101
    [&lt;ffffffff81154745&gt;] sys_lsetxattr+0x6a/0x8f
    [&lt;ffffffff814efda9&gt;] system_call_fastpath+0x16/0x1b
    [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff
unreferenced object 0xffff88024163c5a0 (size 96):
  comm "systemd", pid 1, jiffies 4294683888 (age 94.553s)
  hex dump (first 32 bytes):
    00 00 00 00 ed 41 00 00 00 00 00 00 00 00 00 00  .....A..........
    00 00 00 00 00 00 00 00 0c 64 42 4f 00 00 00 00  .........dBO....
  backtrace:
    [&lt;ffffffff814cb1d0&gt;] kmemleak_alloc+0x73/0x98
    [&lt;ffffffff81127402&gt;] kmem_cache_alloc_trace+0xc4/0xee
    [&lt;ffffffff81191cbe&gt;] sysfs_init_inode_attrs+0x2a/0x83
    [&lt;ffffffff81191dd6&gt;] sysfs_setxattr+0xbf/0x117
    [&lt;ffffffff811542f0&gt;] __vfs_setxattr_noperm+0x73/0xd9
    [&lt;ffffffff811543d9&gt;] vfs_setxattr+0x83/0xa1
    [&lt;ffffffff811544c6&gt;] setxattr+0xcf/0x101
    [&lt;ffffffff81154745&gt;] sys_lsetxattr+0x6a/0x8f
    [&lt;ffffffff814efda9&gt;] system_call_fastpath+0x16/0x1b
    [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff
`

Signed-off-by: Masami Ichikawa &lt;masami256@gmail.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 3.3-rc2 into the driver-core-next branch.</title>
<updated>2012-02-02T19:24:44Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2012-02-02T19:24:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bd1d462e13b278fc57752d0b9b15040e60e561a0'/>
<id>urn:sha1:bd1d462e13b278fc57752d0b9b15040e60e561a0</id>
<content type='text'>
This was done to resolve a merge and build problem with the
drivers/acpi/processor_driver.c file.

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sysfs: Update the name hash when renaming sysfs entries</title>
<updated>2012-01-31T19:30:48Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2012-01-31T14:40:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d5c38b137ac8a6e3dbed13bc494d60df5b69dfc4'/>
<id>urn:sha1:d5c38b137ac8a6e3dbed13bc494d60df5b69dfc4</id>
<content type='text'>
This fixes a bug introduced with sysfs name hashes where renaming a
network device appears to succeed but silently makes the sysfs files for
that network device inaccessible.

In at least one configuration this bug has stopped networking from
coming up during boot.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Tested-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
</feed>
