<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfsd/auth.c, branch linux-4.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-10-08T01:46:30Z</updated>
<entry>
<title>cred: simpler, 1D supplementary groups</title>
<updated>2016-10-08T01:46:30Z</updated>
<author>
<name>Alexey Dobriyan</name>
</author>
<published>2016-10-08T00:03:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=81243eacfa400f5f7b89f4c2323d0de9982bb0fb'/>
<id>urn:sha1:81243eacfa400f5f7b89f4c2323d0de9982bb0fb</id>
<content type='text'>
Current supplementary groups code can massively overallocate memory and
is implemented in a way so that access to individual gid is done via 2D
array.

If number of gids is &lt;= 32, memory allocation is more or less tolerable
(140/148 bytes).  But if it is not, code allocates full page (!)
regardless and, what's even more fun, doesn't reuse small 32-entry
array.

2D array means dependent shifts, loads and LEAs without possibility to
optimize them (gid is never known at compile time).

All of the above is unnecessary.  Switch to the usual
trailing-zero-len-array scheme.  Memory is allocated with
kmalloc/vmalloc() and only as much as needed.  Accesses become simpler
(LEA 8(gi,idx,4) or even without displacement).

Maximum number of gids is 65536 which translates to 256KB+8 bytes.  I
think kernel can handle such allocation.

On my usual desktop system with whole 9 (nine) aux groups, struct
group_info shrinks from 148 bytes to 44 bytes, yay!

Nice side effects:

 - "gi-&gt;gid[i]" is shorter than "GROUP_AT(gi, i)", less typing,

 - fix little mess in net/ipv4/ping.c
   should have been using GROUP_AT macro but this point becomes moot,

 - aux group allocation is persistent and should be accounted as such.

Link: http://lkml.kernel.org/r/20160817201927.GA2096@p183.telecom.by
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Vasily Kulikov &lt;segoon@openwall.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nfsd: silence sparse warning about accessing credentials</title>
<updated>2014-07-17T20:15:35Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2014-07-15T16:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ae4b884fc6316b3190be19448cea24b020c1cad6'/>
<id>urn:sha1:ae4b884fc6316b3190be19448cea24b020c1cad6</id>
<content type='text'>
sparse says:

    fs/nfsd/auth.c:31:38: warning: incorrect type in argument 1 (different address spaces)
    fs/nfsd/auth.c:31:38:    expected struct cred const *cred
    fs/nfsd/auth.c:31:38:    got struct cred const [noderef] &lt;asn:4&gt;*real_cred

Add a new accessor for the -&gt;real_cred and use that to fetch the
pointer. Accessing current-&gt;real_cred directly is actually quite safe
since we know that they can't go away so this is mostly a cosmetic fixup
to silence sparse.

Signed-off-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>NFSD: Cleanup unused variable in nfsd_setuser()</title>
<updated>2014-05-30T21:32:21Z</updated>
<author>
<name>Kinglong Mee</name>
</author>
<published>2014-05-23T12:53:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61a27f08a63ee9460653633d8a9cc5a09dcb9aa5'/>
<id>urn:sha1:61a27f08a63ee9460653633d8a9cc5a09dcb9aa5</id>
<content type='text'>
Commit 8f6c5ffc8987 ("kernel/groups.c: remove return value of
set_groups") removed the last use of "ret".

Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>NFSD: remove unneeded linux/user_namespace.h include</title>
<updated>2014-05-30T21:32:20Z</updated>
<author>
<name>Kinglong Mee</name>
</author>
<published>2014-05-23T12:53:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0faed901c680b153ca090a766ceda699b55993eb'/>
<id>urn:sha1:0faed901c680b153ca090a766ceda699b55993eb</id>
<content type='text'>
After commit 4c1e1b34d5c8 ("nfsd: Store ex_anon_uid and ex_anon_gid as
kuids and kgids") using kuid/kgid for ex_anon_uid/ex_anon_gid,
user_namespace.h is not needed.

Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>kernel/groups.c: remove return value of set_groups</title>
<updated>2014-04-03T23:21:05Z</updated>
<author>
<name>Wang YanQing</name>
</author>
<published>2014-04-03T21:48:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8f6c5ffc8987f4f5b5a3e9d557d94bbf3a9bf216'/>
<id>urn:sha1:8f6c5ffc8987f4f5b5a3e9d557d94bbf3a9bf216</id>
<content type='text'>
After commit 6307f8fee295 ("security: remove dead hook task_setgroups"),
set_groups will always return zero, so we could just remove return value
of set_groups.

This patch reduces code size, and simplfies code to use set_groups,
because we don't need to check its return value any more.

[akpm@linux-foundation.org: remove obsolete claims from set_groups() comment]
Signed-off-by: Wang YanQing &lt;udknight@gmail.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: Eric Paris &lt;eparis@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nfsd: Properly compare and initialize kuids and kgids</title>
<updated>2013-02-13T14:16:09Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2013-02-02T14:53:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6fab877900030ba3ae11928efb6087589f1e514c'/>
<id>urn:sha1:6fab877900030ba3ae11928efb6087589f1e514c</id>
<content type='text'>
Use uid_eq(uid, GLOBAL_ROOT_UID) instead of !uid.
Use gid_eq(gid, GLOBAL_ROOT_GID) instead of !gid.
Use uid_eq(uid, INVALID_UID) instead of uid == -1
Use gid_eq(uid, INVALID_GID) instead of gid == -1
Use uid = GLOBAL_ROOT_UID instead of uid = 0;
Use gid = GLOBAL_ROOT_GID instead of gid = 0;
Use !uid_eq(uid1, uid2) instead of uid1 != uid2.
Use !gid_eq(gid1, gid2) instead of gid1 != gid2.
Use uid_eq(uid1, uid2) instead of uid1 == uid2.

Cc: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Cc: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>nfsd: Store ex_anon_uid and ex_anon_gid as kuids and kgids</title>
<updated>2013-02-13T14:16:08Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2013-02-02T14:42:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4c1e1b34d5c800ad3ac9a7e2805b0bea70ad2278'/>
<id>urn:sha1:4c1e1b34d5c800ad3ac9a7e2805b0bea70ad2278</id>
<content type='text'>
Cc: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Cc: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-3.5' of git://linux-nfs.org/~bfields/linux</title>
<updated>2012-06-01T15:32:58Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2012-06-01T15:32:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=419f4319495043a9507ac3e616be9ca60af09744'/>
<id>urn:sha1:419f4319495043a9507ac3e616be9ca60af09744</id>
<content type='text'>
Pull the rest of the nfsd commits from Bruce Fields:
 "... and then I cherry-picked the remainder of the patches from the
  head of my previous branch"

This is the rest of the original nfsd branch, rebased without the
delegation stuff that I thought really needed to be redone.

I don't like rebasing things like this in general, but in this situation
this was the lesser of two evils.

* 'for-3.5' of git://linux-nfs.org/~bfields/linux: (50 commits)
  nfsd4: fix, consolidate client_has_state
  nfsd4: don't remove rebooted client record until confirmation
  nfsd4: remove some dprintk's and a comment
  nfsd4: return "real" sequence id in confirmed case
  nfsd4: fix exchange_id to return confirm flag
  nfsd4: clarify that renewing expired client is a bug
  nfsd4: simpler ordering of setclientid_confirm checks
  nfsd4: setclientid: remove pointless assignment
  nfsd4: fix error return in non-matching-creds case
  nfsd4: fix setclientid_confirm same_cred check
  nfsd4: merge 3 setclientid cases to 2
  nfsd4: pull out common code from setclientid cases
  nfsd4: merge last two setclientid cases
  nfsd4: setclientid/confirm comment cleanup
  nfsd4: setclientid remove unnecessary terms from a logical expression
  nfsd4: move rq_flavor into svc_cred
  nfsd4: stricter cred comparison for setclientid/exchange_id
  nfsd4: move principal name into svc_cred
  nfsd4: allow removing clients not holding state
  nfsd4: rearrange exchange_id logic to simplify
  ...
</content>
</entry>
<entry>
<title>nfsd4: move rq_flavor into svc_cred</title>
<updated>2012-06-01T00:29:58Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2012-05-15T02:06:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d5497fc693a446ce9100fcf4117c3f795ddfd0d2'/>
<id>urn:sha1:d5497fc693a446ce9100fcf4117c3f795ddfd0d2</id>
<content type='text'>
Move the rq_flavor into struct svc_cred, and use it in setclientid and
exchange_id comparisons as well.

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>userns: Convert group_info values from gid_t to kgid_t.</title>
<updated>2012-05-03T10:27:21Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2011-11-14T23:56:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ae2975bc3476243b45a1e2344236d7920c268f38'/>
<id>urn:sha1:ae2975bc3476243b45a1e2344236d7920c268f38</id>
<content type='text'>
As a first step to converting struct cred to be all kuid_t and kgid_t
values convert the group values stored in group_info to always be
kgid_t values.   Unless user namespaces are used this change should
have no effect.

Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
</feed>
