From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Paul Moore <paul@paul-moore.com>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: linux-next: manual merge of the audit tree with Linus' tree
Date: Tue, 20 Jan 2015 15:03:53 +1100 [thread overview]
Message-ID: <20150120150353.4b11b2c4@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 2866 bytes --]
Hi Paul,
Today's linux-next merge of the audit tree got a conflict in
kernel/auditsc.c between commit 4a92843601ad ("audit: correctly record
file names with different path name types") and fcf22d8267ad ("audit:
create private file name copies when auditing inodes") from Linus' tree
and commits 997f7ee82a98 ("audit: enable filename recording via
getname_kernel()"), 2b1b63a2b7d3 ("audit: fix filename matching in
__audit_inode() and __audit_inode_child()") and 49463ee9d929 ("audit:
replace getname()/putname() hacks with reference counters") from the
audit tree.
It would have been nice if these new audit tree commits had been based
on v3.19-rc3 instead of v3.16 ... (especially since their Author dates
match their Committer dates).
I fixed it up (basically I used the audit tree versions - based on the
commit comments - see below) and can carry the fix as necessary (no
action is required).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc kernel/auditsc.c
index 55f82fce2526,459a54555151..000000000000
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@@ -1878,48 -1802,17 +1804,15 @@@ void __audit_inode(struct filename *nam
}
out_alloc:
- /* unable to find the name from a previous getname(). Allocate a new
- * anonymous entry.
- */
+ /* unable to find an entry with both a matching name and type */
- n = audit_alloc_name(context, AUDIT_TYPE_UNKNOWN);
+ n = audit_alloc_name(context, AUDIT_TYPE_NORMAL);
if (!n)
return;
- /* unfortunately, while we may have a path name to record with the
- * inode, we can't always rely on the string lasting until the end of
- * the syscall so we need to create our own copy, it may fail due to
- * memory allocation issues, but we do our best */
if (name) {
- /* we can't use getname_kernel() due to size limits */
- size_t len = strlen(name->name) + 1;
- struct filename *new = __getname();
-
- if (unlikely(!new))
- goto out;
-
- if (len <= (PATH_MAX - sizeof(*new))) {
- new->name = (char *)(new) + sizeof(*new);
- new->separate = false;
- } else if (len <= PATH_MAX) {
- /* this looks odd, but is due to final_putname() */
- struct filename *new2;
-
- new2 = kmalloc(sizeof(*new2), GFP_KERNEL);
- if (unlikely(!new2)) {
- __putname(new);
- goto out;
- }
- new2->name = (char *)new;
- new2->separate = true;
- new = new2;
- } else {
- /* we should never get here, but let's be safe */
- __putname(new);
- goto out;
- }
- strlcpy((char *)new->name, name->name, len);
- new->uptr = NULL;
- new->aname = n;
- n->name = new;
- n->name_put = true;
+ n->name = name;
+ name->refcnt++;
}
+
out:
if (parent) {
n->name_len = n->name ? parent_len(n->name->name) : AUDIT_NAME_FULL;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next reply other threads:[~2015-01-20 4:03 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-20 4:03 Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-04-08 1:31 linux-next: manual merge of the audit tree with Linus' tree Stephen Rothwell
2019-04-08 17:15 ` Dmitry V. Levin
2019-04-08 20:30 ` Paul Moore
2017-03-24 2:18 Stephen Rothwell
2017-03-24 6:33 ` Richard Guy Briggs
2017-03-24 16:39 ` Paul Moore
2017-01-19 2:51 Stephen Rothwell
2017-01-19 4:16 ` Richard Guy Briggs
2016-11-22 5:29 Stephen Rothwell
2016-11-22 10:35 ` Richard Guy Briggs
2016-11-22 21:25 ` Paul Moore
2016-01-19 1:02 Stephen Rothwell
2016-01-19 2:48 ` Paul Moore
2015-11-19 1:06 Stephen Rothwell
2015-11-19 15:53 ` Paul Moore
2015-11-19 18:30 ` Richard Guy Briggs
2015-11-19 20:16 ` Stephen Rothwell
2015-10-06 2:55 Stephen Rothwell
2015-10-06 17:21 ` Paul Moore
2015-08-07 4:15 Stephen Rothwell
2015-08-07 6:33 ` Richard Guy Briggs
2015-06-01 6:30 Stephen Rothwell
2015-06-01 15:59 ` Richard Guy Briggs
2015-01-20 4:04 Stephen Rothwell
2015-01-20 4:04 Stephen Rothwell
2015-01-20 15:45 ` Paul Moore
2014-04-22 3:58 Stephen Rothwell
2014-04-16 4:02 Stephen Rothwell
2014-04-16 12:08 ` Eric Paris
2014-04-01 4:07 Stephen Rothwell
2014-04-01 12:54 ` Richard Guy Briggs
2014-04-01 13:11 ` Stephen Rothwell
2014-01-15 4:48 Stephen Rothwell
2013-11-06 6:19 Stephen Rothwell
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=20150120150353.4b11b2c4@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=paul@paul-moore.com \
/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 NNTP newsgroup(s).